Counterexample-Driven Genetic Programming

Size: px
Start display at page:

Download "Counterexample-Driven Genetic Programming"

Transcription

1 Counterexample-Driven Genetic Programming Iwo Błądek, Krzysztof Krawiec Institute of Computing Science, Poznań University of Technology Poznań, I. Błądek, K. Krawiec Counterexample-Driven Genetic Programming 1 / 58

2 Plan of the Presentation 1 Introduction 2 Counterexample-Driven GP (part 1) 3 Satisfiability Modulo Theories (SMT) 4 SMT-based verification 5 Counterexample-Driven GP (part 2) 6 Experiments I. Błądek, K. Krawiec Counterexample-Driven Genetic Programming 2 / 58

3 Program Synthesis Aim of program synthesis is to find a program given its desired behavior. bool isgreater(int x, int y) { if (x > y) return true;? else return false; } a b c? x 2 +? x 2 x = 1, y = 5 x = 5, y = 1 a = 1, b = 0, c = 0 a = 0, b = 0, c = 0 x = 1 x = 0 false true I. Błądek, K. Krawiec Counterexample-Driven Genetic Programming 3 / 58

4 Program Specification The desired behavior of a program is described by its specification. The most commonly used types of specifications are: Input-output examples (test cases) x y max(x,y) Formal specification (logical relations between input and output) x,y max(x, y) x max(x, y) y (max(x, y) = x max(x, y) = y) I. Błądek, K. Krawiec Counterexample-Driven Genetic Programming 4 / 58

5 Program Specification Input-output examples are a special case of formal specification: x,y ([(x = 0 y = 0) = max(x, y) = 0] [(x = 1 y = 0) = max(x, y) = 1] [(x = 4 y = 3) = max(x, y) = 4] ) Or simpler: max(0, 0) = 0 max(1, 0) = 1 max(3, 4) = 4 I. Błądek, K. Krawiec Counterexample-Driven Genetic Programming 4 / 58

6 Provably-correct programs To prove that program is correct for all inputs, a formal specification needs to be used (or all possible input-output examples enumerated) In certain applications hoping for algorithm s generalization is not enough: Safety-critical systems (!) Software development Hardware design Finding mathematical structures with certain properties I. Błądek, K. Krawiec Counterexample-Driven Genetic Programming 5 / 58

7 Plan of the Presentation 1 Introduction 2 Counterexample-Driven GP (part 1) 3 Satisfiability Modulo Theories (SMT) 4 SMT-based verification 5 Counterexample-Driven GP (part 2) 6 Experiments I. Błądek, K. Krawiec Counterexample-Driven Genetic Programming 6 / 58

8 Counterexample-Driven GP First described in: K.Krawiec, I.Błądek, J.Swan, Counterexample-Driven Genetic Programming, Proceedings of the Genetic and Evolutionary Computation Conference. GECCO 17. Berlin, Germany. [1] (Best Paper Award in the Genetic Programming track) Follow-up: submitted to Evolutionary Computation Journal I. Błądek, K. Krawiec Counterexample-Driven Genetic Programming 7 / 58

9 Counterexample-Driven GP Goal: Automatic synthesis of programs which are proved to correctly realize a formally defined task Contributions: GP algorithm capable of synthesizing such programs from formal specifications (spec for short) Systematization of spec properties and their consequences for program evaluation I. Błądek, K. Krawiec Counterexample-Driven Genetic Programming 8 / 58

10 Counterexample-Driven GP Main ideas: Verify programs generated by GP to guarantee their correctness Incrementally supply GP with test cases created from counterexamples returned by failed verifications GP search Program Fitness Testing T c All passed? Verification Counterexample I. Błądek, K. Krawiec Counterexample-Driven Genetic Programming 9 / 58

11 Plan of the Presentation 1 Introduction 2 Counterexample-Driven GP (part 1) 3 Satisfiability Modulo Theories (SMT) 4 SMT-based verification 5 Counterexample-Driven GP (part 2) 6 Experiments I. Błądek, K. Krawiec Counterexample-Driven Genetic Programming 10 / 58

12 Satisfiability Problem (SAT) Question: Is a formula in the propositional calculus satisfiable? Examples: a b SAT: a = false, b = true a a b UNSAT I. Błądek, K. Krawiec Counterexample-Driven Genetic Programming 11 / 58

13 Satisfiability Modulo Theories (SMT) Question: Is a formula in the first-order logic satisfiable under the background theory T, which defines semantics of a certain set of symbols? Examples: Logic: QF_LIA (Quantifier-Free Linear Integer Arithmetic) x, y, z Z a {false, true} (10 x = 20) a SAT: x = 2, a = true (x < y) (y < z) (z < x) UNSAT (x y) (y z) (z x) SAT: x = 0, y = 0, z = 0 I. Błądek, K. Krawiec Counterexample-Driven Genetic Programming 12 / 58

14 Satisfiability Modulo Theories (SMT) Question: Is a formula in the first-order logic satisfiable under the background theory T, which defines semantics of a certain set of symbols? Examples: Logic: NIA (Non-Linear Integer Arithmetic) x, y Z x x SAT: x = 1 x,y (x + y) 2 > x 2 + y 2 UNSAT I. Błądek, K. Krawiec Counterexample-Driven Genetic Programming 12 / 58

15 Satisfiability Modulo Theories (SMT) Question: Is a formula in the first-order logic satisfiable under the background theory T, which defines semantics of a certain set of symbols? Examples: Logic: QF S (Quantifier-Free Strings) x, y String str.len(x ++ y) str.len(x) + str.len(y) UNSAT str.substr(x, 0, 2) = str.substr(x, 2, 2) str.at(x, 0) str.at(x, 1) SAT: x = "abab" I. Błądek, K. Krawiec Counterexample-Driven Genetic Programming 12 / 58

16 SMT Solvers SMT Solver any software that can check satisfiability of formulas modulo some given theory. There are several freely accessible SMT solvers: CVC4 (open source) MathSAT (free for non-commercial use) Z3, by Microsoft Research (open source) Most SMT solvers accept queries in SMT-LIB language ( which was created to standardize interaction with different solvers. I. Błądek, K. Krawiec Counterexample-Driven Genetic Programming 13 / 58

17 Short SMT-LIB course (set-logic LIA) sets theory to Ints and limits considerations to only linear integer arithmetic I. Błądek, K. Krawiec Counterexample-Driven Genetic Programming 14 / 58

18 Short SMT-LIB course (set-logic LIA) sets theory to Ints and limits considerations to only linear integer arithmetic (declare-fun x () Int) declares a free variable x of type Int I. Błądek, K. Krawiec Counterexample-Driven Genetic Programming 14 / 58

19 Short SMT-LIB course (set-logic LIA) sets theory to Ints and limits considerations to only linear integer arithmetic (declare-fun x () Int) declares a free variable x of type Int (define-fun fun ((a Int)(b Int)) Int (+ a b)) defines a function for later use I. Błądek, K. Krawiec Counterexample-Driven Genetic Programming 14 / 58

20 Short SMT-LIB course (set-logic LIA) sets theory to Ints and limits considerations to only linear integer arithmetic (declare-fun x () Int) declares a free variable x of type Int (define-fun fun ((a Int)(b Int)) Int (+ a b)) defines a function for later use (assert (= (fun x 2) 0)) adds an assertion (constraint) I. Błądek, K. Krawiec Counterexample-Driven Genetic Programming 14 / 58

21 Short SMT-LIB course (set-logic LIA) sets theory to Ints and limits considerations to only linear integer arithmetic (declare-fun x () Int) declares a free variable x of type Int (define-fun fun ((a Int)(b Int)) Int (+ a b)) defines a function for later use (assert (= (fun x 2) 0)) adds an assertion (constraint) (check-sat) a command instructing solver to check satisfiability I. Błądek, K. Krawiec Counterexample-Driven Genetic Programming 14 / 58

22 Plan of the Presentation 1 Introduction 2 Counterexample-Driven GP (part 1) 3 Satisfiability Modulo Theories (SMT) 4 SMT-based verification 5 Counterexample-Driven GP (part 2) 6 Experiments I. Błądek, K. Krawiec Counterexample-Driven Genetic Programming 15 / 58

23 SMT-based program verification To check program correctness we need to prove: which can be posed as disproving: in Pre(in) = Post(in, p(in)) in Pre(in) = Post(in, p(in)). p a program in inputs to the program Pre(in) precondition. Behavior of the program is defined only for inputs that satisfy Pre(in). Post(in, out) postcondition. Describes the expected behavior of the program. I. Błądek, K. Krawiec Counterexample-Driven Genetic Programming 16 / 58

24 An example of SMT verification Task: Synthesize a program max(x, y) returning a maximum of two numbers. max(x, y) = { x, if x y. y, otherwise. Formal specification: max(x, y) x max(x, y) y (max(x, y) = x max(x, y) = y) I. Błądek, K. Krawiec Counterexample-Driven Genetic Programming 17 / 58

25 An example of SMT verification Incorrect program: if x < y: res = x else: res = y Program encoded as SMT formulas: ; PROGRAM (=> (< x y) (and (= res x) (= res res))) (=> (not (< x y)) (and (= res y) (= res res ))) I. Błądek, K. Krawiec Counterexample-Driven Genetic Programming 18 / 58

26 An example of SMT verification Verification constraints in SMT-LIB for the incorrect program: ; PRECONDITION (assert true) ; PROGRAM (assert (=> (< x y) (and (= res x) (= res res)))) (assert (=> (not (< x y)) (and (= res y) (= res res )))) ; POSTCONDITION (assert (not (and (>= res x) (>= res y) (or (= res x) (= res y))))) I. Błądek, K. Krawiec Counterexample-Driven Genetic Programming 19 / 58

27 An example of SMT verification Incorrect program: if x < y: res = x else: res = y Solver result: SAT x = -1 y = 0 This answer means that the program is not correct and solver provides us a counterexample. I. Błądek, K. Krawiec Counterexample-Driven Genetic Programming 20 / 58

28 An example of SMT verification Correct program: if x > y: res = x else: res = y Solver result: UNSAT This answer means that the program is correct with respect to the specification. No counterexample was found. I. Błądek, K. Krawiec Counterexample-Driven Genetic Programming 21 / 58

29 Plan of the Presentation 1 Introduction 2 Counterexample-Driven GP (part 1) 3 Satisfiability Modulo Theories (SMT) 4 SMT-based verification 5 Counterexample-Driven GP (part 2) 6 Experiments I. Błądek, K. Krawiec Counterexample-Driven Genetic Programming 22 / 58

30 Counterexample-Driven GP Main ideas: Verify programs generated by GP to guarantee their correctness Incrementally supply GP with test cases created from counterexamples returned by failed verifications GP search Program Fitness Testing T c All passed? Verification Counterexample I. Błądek, K. Krawiec Counterexample-Driven Genetic Programming 23 / 58

31 Program representation Programs in SMT-LIB Language Purely functional Represented in GP as traditional program trees Examples: x (mod x 2) (* 2 (ite (>= x y) 2 (+ x y))) I. Błądek, K. Krawiec Counterexample-Driven Genetic Programming 24 / 58

32 Search operators Mutation (50%) / Crossover (50%) Only well-typed programs are generated Examples: Mutation: (ite (>= x y) 2 (+ x y)) (ite (< y 0) 2 (+ x y)) Crossover: (mod x 2) (ite (>= x y) 2 (+ x y)) (mod (+ x y) 2) (ite (>= x y) 2 x) I. Błądek, K. Krawiec Counterexample-Driven Genetic Programming 25 / 58

33 Verification Generated solutions are verified if they pass a certain ratio of test cases (TestsRatio) unsat program correct sat program incorrect Verification query to SMT solver: (set-logic LIA) (define-fun max ((x Int)(y Int)) Int (ite (>= y x) x y)) (declare-fun x () Int) (declare-fun y () Int) (assert (not (and (>= (max x y) x) (>= (max x y) y) (or (= (max x y) x) (= (max x y) y))))) (check-sat) (get-value (x y)) I. Błądek, K. Krawiec Counterexample-Driven Genetic Programming 26 / 58

34 Example run Log for Median3 problem: Tests: found: 0 total: 0 known outputs: 0 Added test: (Map(a -> -70, b -> 0, c -> -70),Some(-70)) Added test: (Map(a -> -1, b -> -8, c -> 0),Some(-1)) Added test: (Map(a -> 0, b -> 5, c -> 0),Some(0)) Added test: (Map(a -> 0, b -> 0, c -> 1),Some(0)) Added test: (Map(a -> -2, b -> -1, c -> -2),Some(-2)) Added test: (Map(a -> -1, b -> 0, c -> 0),Some(0)) Added test: (Map(a -> 0, b -> 0, c -> -3),Some(0)) Added test: (Map(a -> 0, b -> 1, c -> -1),Some(0)) Tests: found: 8 total: 8 known outputs: 8 Added test: (Map(a -> -1, b -> 0, c -> -1),Some(-1)) Tests: found: 1 total: 9 known outputs: 9 Added test: (Map(a -> -7, b -> -6, c -> -7),Some(-7)) Tests: found: 1 total: 10 known outputs: 10 Tests: found: 0 total: 10 known outputs: 10 Tests: found: 0 total: 10 known outputs: 10 I. Błądek, K. Krawiec Counterexample-Driven Genetic Programming 27 / 58

35 Different types of formal specifications Spec 1: f (x, y) x f (x, y) y (f (x, y) = x f (x, y) = y) Spec 2: (in 2 = 0 = f (in 2 ) = 0) (in 2 > 0 = f (in 2 ) = in 2 + 1) Spec 3: f (x, y + 1) = f (x, y) + 1 f (x + 1, y) = f (x, y) + 1 (x = 0 y = 0 = f (x, y) = 0) I. Błądek, K. Krawiec Counterexample-Driven Genetic Programming 28 / 58

36 Single-invocation property In the constraints every call to synthesis-function has the same arguments. Correctness of a function on a single input does not depend on function s values on other inputs. Can be checked by syntactic analysis. Spec 1: single-invocation f (x, y) x f (x, y) y (f (x, y) = x f (x, y) = y) Invocations: (x, y) I. Błądek, K. Krawiec Counterexample-Driven Genetic Programming 29 / 58

37 Single-invocation property In the constraints every call to synthesis-function has the same arguments. Correctness of a function on a single input does not depend on function s values on other inputs. Can be checked by syntactic analysis. Spec 3: multiple-invocation f (x, y + 1) = f (x, y) + 1 f (x + 1, y) = f (x, y) + 1 (x = 0 y = 0 = f (x, y) = 0) Invocations: (x, y + 1), (x + 1, y), (x, y) I. Błądek, K. Krawiec Counterexample-Driven Genetic Programming 29 / 58

38 Single-output property For a single input there is only one correct output. Can be considered locally (single input) or globally (all inputs). Can be checked by a query to SMT solver. Spec 1: single-output f (x, y) x f (x, y) y (f (x, y) = x f (x, y) = y) The maximum of two numbers is strictly defined as a concrete value. Compare this with f (x) 0 property, for which there is infinitely many correct outputs for a single input. I. Błądek, K. Krawiec Counterexample-Driven Genetic Programming 30 / 58

39 Single-output property For a single input there is only one correct output. Can be considered locally (single input) or globally (all inputs). Can be checked by a query to SMT solver. Spec 2: multiple-output (in 2 = 0 = f (in 2 ) = 0) (in 2 > 0 = f (in 2 ) = in 2 + 1) For in 2 < 0 outputs of f are undefined, which means that any integer is a valid output. I. Błądek, K. Krawiec Counterexample-Driven Genetic Programming 30 / 58

40 Single-output property Query to SMT solver (checking globally): (set-logic LIA) (declare-fun out1 () Int) (declare-fun out2 () Int) (define-fun max 1 ((x Int)(y Int)) Int out1) (define-fun max 2 ((x Int)(y Int)) Int out2) (declare-fun x () Int) (declare-fun y () Int) (assert (>= (max 1 x y) x)) (assert (>= (max 1 x y) y)) (assert (or (= x (max 1 x y)) (= y (max 1 x y)))) (assert (>= (max 2 x y) x)) (assert (>= (max 2 x y) y)) (assert (or (= x (max 2 x y)) (= y (max 2 x y)))) (assert (distinct out1 out2)) (check-sat) I. Błądek, K. Krawiec Counterexample-Driven Genetic Programming 31 / 58

41 Single-output property Queries to SMT solver (checking locally): (set-logic LIA) (declare-fun out () Int) (define-fun max ((x Int)(y Int)) Int out) (define-fun x () Int (- 1)) (define-fun y () Int 0) (assert (>= (max x y) x)) (assert (>= (max x y) y)) (assert (or (= (max x y) x) (= (max x y) y))) ; ; Added in the 2nd query, after 0 is found to be a correct output. ; If other correct output is found, then single-output does not hold. (assert (distinct out 0)) ; (check-sat) (get-value (out)) I. Błądek, K. Krawiec Counterexample-Driven Genetic Programming 32 / 58

42 Different types of formal specifications Spec 1: single-invocation, single-output standard evaluation f (x, y) x f (x, y) y (f (x, y) = x f (x, y) = y) Spec 2: single-invocation, multiple-output evaluation by solver (in 2 = 0 = f (in 2 ) = 0) (in 2 > 0 = f (in 2 ) = in 2 + 1) Spec 3: multiple-invocation, single-output evaluation by solver f (x, y + 1) = f (x, y) + 1 f (x + 1, y) = f (x, y) + 1 (x = 0 y = 0 = f (x, y) = 0) I. Błądek, K. Krawiec Counterexample-Driven Genetic Programming 33 / 58

43 Standard evaluation Program tree is recursively reduced to a constant by function applications on leaves Obtained constant is then compared with the expected output Requires single-invocation for problem, and single-output for the considered input Example: (ite (>= x y) y (+ x y)) x 3, y 4 1. (ite (>= 3 4) 4 (+ 3 4)) 2. (ite (>= 3 4) 4 7) (expected answer) I. Błądek, K. Krawiec Counterexample-Driven Genetic Programming 34 / 58

44 Evaluation by solver Query to SMT solver: (set-logic LIA) (define-fun max ((x Int)(y Int)) Int (ite (>= x y) y x)) (define-fun x () Int (- 1)) (define-fun y () Int 0) (assert (>= (max x y) x)) (assert (>= (max x y) y)) (assert (or (= (max x y) x) (= (max x y) y)))) (check-sat) sat correct behavior of the program on the test unsat incorrect behavior I. Błądek, K. Krawiec Counterexample-Driven Genetic Programming 35 / 58

45 Plan of the Presentation 1 Introduction 2 Counterexample-Driven GP (part 1) 3 Satisfiability Modulo Theories (SMT) 4 SMT-based verification 5 Counterexample-Driven GP (part 2) 6 Experiments I. Błądek, K. Krawiec Counterexample-Driven Genetic Programming 36 / 58

46 Benchmarks LIA Benchmarks marked with * were created by us. Other were taken from SyGuS competition ( Name Arity Semantics *CountPos 2, 3, 4 The number of positive arguments *IsSeries 3, 4 Do arguments form an arithmetic series? *IsSorted 4, 5 Are arguments in ascending order? *Median 3 The median of arguments *Range 3 The range of arguments Max 4 The maximum of arguments Search 2, 3, 4 The index of an argument among the other arguments Sum 2, 3, 4 The sum of arguments I. Błądek, K. Krawiec Counterexample-Driven Genetic Programming 37 / 58

47 LIA Example: CountPos2 (set-logic LIA) (synth-fun countpositive2 ((a Int) (b Int)) Int) (declare-var a Int) (declare-var b Int) (constraint (=> (and (<= a 0) (<= b 0)) (= (countpositive2 a b) 0))) (constraint (=> (and (> a 0) (<= b 0)) (= (countpositive2 a b) 1))) (constraint (=> (and (<= a 0) (> b 0)) (= (countpositive2 a b) 1))) (constraint (=> (and (> a 0) (> b 0)) (= (countpositive2 a b) 2))) (check-synth) I. Błądek, K. Krawiec Counterexample-Driven Genetic Programming 38 / 58

48 Benchmarks SLIA Benchmarks are based on those from SyGuS competition. The test-based specification was converted to a formal one covering all inputs. Name Arity Semantics dr-name 1 Extract first name from full name and prepend it with Dr. firstname 1 Extract first name from full name initials 1 Extract initials name from full name lastname 1 Extract last name from full name combine 2 Combine first and last name into full name combine-2 2 Combine first and last name into first name followed by initial combine-3 2 Combine first and last name into initial followed by last name combine-4 2 Combine first and last name into last name followed by initial phone 1 Extract the first triplet of digits from a phone number phone-1 1 Extract the second triplet of digits from a phone number phone-2 1 Extract the third triplet of digits from a phone number phone-3 1 Put first three digits of a phone number in parentheses phone-4 1 Change all - in a phone number to. I. Błądek, K. Krawiec Counterexample-Driven Genetic Programming 39 / 58

49 SLIA Example: combine-4 (set-logic SLIA) (synth-fun f ((name String)) String SLIA_GRAMMAR) (declare-var firstname String) (declare-var lastname String) ; (constraint (= (f "Launa" "Withers") "Withers, L.")) ; (constraint (= (f "Lakenya" "Edison") "Edison, L.")) ; (constraint (= (f "Brendan" "Hage") "Hage, B.")) (constraint (= (f firstname lastname) (str.++ lastname ", " (str.at firstname 0) "." ) )) (check-synth) I. Błądek, K. Krawiec Counterexample-Driven Genetic Programming 40 / 58

50 SLIA Example: dr-name (set-logic SLIA) (synth-fun f ((name String)) String SLIA_GRAMMAR) (define-fun ithsplit((s String)(delim String)(i Int))...) (define-fun precond ((s String)) Bool (and (distinct (str.indexof s " " 0) (- 1))... (distinct (str.at s (- (str.len s) 1)) " "))) (declare-var s String) ; (constraint (= (f "Nancy FreeHafer") "Dr. Nancy")) ; (constraint (= (f "Mariya Sergienko") "Dr. Mariya")) ; (constraint (= (f "Jan Kotas") "Dr. Jan")) (constraint (=> (precond s) (= (str.len (f s)) (+ (str.indexof s " " 0) 4)))) (constraint (=> (precond s) (= (ithsplit (f s) " " 0) "Dr."))) (constraint (=> (precond s) (= (ithsplit (f s) " " 1) (ithsplit s " " 0) ))) (check-synth) I. Błądek, K. Krawiec Counterexample-Driven Genetic Programming 41 / 58

51 Experiments approaches CDGP GPR our baseline, which adds random tests instead of those found during verification EUSolver enumerates solutions and tries to unify already collected short programs into longer ones CVC4 refutation-based SMT approach to synthesis I. Błądek, K. Krawiec Counterexample-Driven Genetic Programming 42 / 58

52 Experiments configurations EvolutionMode x Selection x TestsRatio EvolutionMode: generational, steady state Selection: Tournament7, Lexicase TestsRatio (CDGP): 0.0, 0.25, 0.5, 0.75, 1.0 TestsRatio (GPR): 0.75, 1.0 I. Błądek, K. Krawiec Counterexample-Driven Genetic Programming 43 / 58

53 Experiments parameters Parameter Value Number of runs 25 Population size 500 Maximum height of initial programs 5 Maximum height of trees inserted by mutation 5 Maximum height of programs in population 12 Maximum number of generations Maximum runtime in seconds 3600 Probability of mutation 0.5 Probability of crossover 0.5 Tournament size 7 I. Błądek, K. Krawiec Counterexample-Driven Genetic Programming 44 / 58

54 Experiments LIA Success rate CDGP GPR EUSolver CVC4 Gener. SteadySt. Gener. SteadySt. Tour Lex Tour Lex Tour Lex Tour Lex CountPos CountPos CountPos IsSeries IsSeries IsSorted IsSorted Max Median Range Search Search Search Sum Sum Sum All I. Błądek, K. Krawiec Counterexample-Driven Genetic Programming 45 / 58

55 Experiments LIA Success rate (2) CDGP GPR EUSolver CVC4 Gener. SteadySt. Gener. SteadySt CountPos CountPos CountPos IsSeries IsSeries IsSorted IsSorted Max Median Range Search Search Search Sum Sum Sum All I. Błądek, K. Krawiec Counterexample-Driven Genetic Programming 46 / 58

56 Experiments LIA Average runtime CDGP GPR EUSolver CVC4 Gener. SteadySt. Gener. SteadySt. Tour Lex Tour Lex Tour Lex Tour Lex CountPos CountPos CountPos IsSeries IsSeries IsSorted IsSorted Max Median Range Search Search Search Sum Sum Sum All I. Błądek, K. Krawiec Counterexample-Driven Genetic Programming 47 / 58

57 Experiments LIA Average runtime (2) CDGP GPR EUSolver CVC4 Gener. SteadySt. Gener. SteadySt CountPos CountPos CountPos IsSeries IsSeries IsSorted IsSorted Max Median Range Search Search Search Sum Sum Sum All I. Błądek, K. Krawiec Counterexample-Driven Genetic Programming 48 / 58

58 Experiments LIA Average generated tests (2) CDGP GPR Gener. SteadySt. Gener. SteadySt CountPos CountPos CountPos IsSeries IsSeries IsSorted IsSorted Max Median Range Search Search Search Sum Sum Sum All I. Błądek, K. Krawiec Counterexample-Driven Genetic Programming 49 / 58

59 Experiments SLIA Success rate CDGP CVC4 1.5 CVC4 head Gener. SteadySt. Tour Lex Tour Lex dr-name firstname initials lastname name-combine name-combine name-combine name-combine phone phone phone phone phone All I. Błądek, K. Krawiec Counterexample-Driven Genetic Programming 50 / 58

60 Experiments SLIA Success rate (2) CDGP CVC4 1.5 CVC4 head Gener. SteadySt dr-name firstname initials lastname name-combine name-combine name-combine name-combine phone phone phone phone phone All I. Błądek, K. Krawiec Counterexample-Driven Genetic Programming 51 / 58

61 Experiments SLIA Average runtime CDGP CVC4 1.5 CVC4 head Gener. SteadySt. Tour Lex Tour Lex dr-name firstname initials lastname name-combine name-combine name-combine name-combine phone phone phone phone phone All I. Błądek, K. Krawiec Counterexample-Driven Genetic Programming 52 / 58

62 Experiments SLIA Average runtime (2) CDGP CVC4 1.5 CVC4 head Gener. SteadySt dr-name firstname initials lastname name-combine name-combine name-combine name-combine phone phone phone phone phone All I. Błądek, K. Krawiec Counterexample-Driven Genetic Programming 53 / 58

63 Experiments SLIA Average generated tests (2) CDGP Gener. SteadySt dr-name firstname initials lastname name-combine name-combine name-combine name-combine phone phone phone phone phone All I. Błądek, K. Krawiec Counterexample-Driven Genetic Programming 54 / 58

64 Experiments Average ranks for Friedman test (LIA): GL75 SL75 GT75 ST75 GL5 GL1 GT1 GL25 SL5 GL0 SL1 GT5 SL0 ST SL25 GPRGL1 GPRGT1 GT25 GT0 GPRGL75 ST25 ST1 GPRGT75 ST0 GPRST1 GPRSL75 GPRSL1 GPRST Post-hoc analysis using symmetry test (described by Hollander, et al.) All CDGP configurations with q = 0.75 are better than all GPR configurations (p < 0.05) (except for ST75) I. Błądek, K. Krawiec Counterexample-Driven Genetic Programming 55 / 58

65 Experiments Average ranks for Friedman test (SLIA): ST1 5.4 GL SL SL ST GT SL1 7.0 ST ST5 7.5 GT GL GL GT1 9.0 SL5 9.3 GL1 9.4 GT ST GT GL SL Post-hoc analysis using symmetry test (described by Hollander, et al.) Most of pairwise differences are statistically insignificant I. Błądek, K. Krawiec Counterexample-Driven Genetic Programming 56 / 58

66 Comparison with formal synthesizers I. Błądek, K. Krawiec Counterexample-Driven Genetic Programming 57 / 58

67 Bibliography I [1] Krzysztof Krawiec, Iwo Błądek, and Jerry Swan. Counterexample-driven Genetic Programming. In: Proceedings of the Genetic and Evolutionary Computation Conference. GECCO 17. Berlin, Germany: ACM, 2017, pp I. Błądek, K. Krawiec Counterexample-Driven Genetic Programming 58 / 58

An Introduction to Satisfiability Modulo Theories

An Introduction to Satisfiability Modulo Theories An Introduction to Satisfiability Modulo Theories Philipp Rümmer Uppsala University Philipp.Ruemmer@it.uu.se February 13, 2019 1/28 Outline From theory... From DPLL to DPLL(T) Slides courtesy of Alberto

More information

arxiv: v1 [cs.pl] 22 May 2014

arxiv: v1 [cs.pl] 22 May 2014 Language to Specify Syntax-Guided Synthesis Problems Mukund Raghothaman Abhishek Udupa Friday 7 th December, 2018 arxiv:1405.5590v1 [cs.pl] 22 May 2014 Abstract We present a language to specify syntax

More information

Language to Specify Syntax-Guided Synthesis Problems

Language to Specify Syntax-Guided Synthesis Problems Language to Specify Syntax-Guided Synthesis Problems Mukund Raghothaman Abhishek Udupa Saturday 25 th January, 2014 1 Introduction We present a language to specify syntax guided synthesis (SyGuS) problems.

More information

EECS 219C: Formal Methods Syntax-Guided Synthesis (selected/adapted slides from FMCAD 13 tutorial by R. Alur) Sanjit A. Seshia EECS, UC Berkeley

EECS 219C: Formal Methods Syntax-Guided Synthesis (selected/adapted slides from FMCAD 13 tutorial by R. Alur) Sanjit A. Seshia EECS, UC Berkeley EECS 219C: Formal Methods Syntax-Guided Synthesis (selected/adapted slides from FMCAD 13 tutorial by R. Alur) Sanjit A. Seshia EECS, UC Berkeley Solving SyGuS Is SyGuS same as solving SMT formulas with

More information

JPF SE: A Symbolic Execution Extension to Java PathFinder

JPF SE: A Symbolic Execution Extension to Java PathFinder JPF SE: A Symbolic Execution Extension to Java PathFinder Saswat Anand 1,CorinaS.Păsăreanu 2, and Willem Visser 2 1 College of Computing, Georgia Institute of Technology saswat@cc.gatech.edu 2 QSS and

More information

Programming with Constraint Solvers CS294: Program Synthesis for Everyone

Programming with Constraint Solvers CS294: Program Synthesis for Everyone Programming with Constraint Solvers CS294: Program Synthesis for Everyone Ras Bodik Emina Torlak Division of Computer Science University of California, Berkeley Today Today: we describe four programming

More information

Testing & Symbolic Execution

Testing & Symbolic Execution Testing & Symbolic Execution Software Testing The most common way of measuring & ensuring correctness Input 2 Software Testing The most common way of measuring & ensuring correctness Input Observed Behavior

More information

Syntax-Guided Synthesis. Rajeev Alur. University of Pennsylvania

Syntax-Guided Synthesis. Rajeev Alur. University of Pennsylvania Syntax-Guided Synthesis Rajeev Alur University of Pennsylvania 1 Program Verification Specification S Program P Verifier Proof of correctness or Witness of a bug 2 Classical Program Synthesis Specification

More information

Generating Small Countermodels. Andrew Reynolds Intel August 30, 2012

Generating Small Countermodels. Andrew Reynolds Intel August 30, 2012 Generating Small Countermodels using SMT Andrew Reynolds Intel August 30, 2012 Acknowledgements Intel Corporation AmitGoel, Sava Krstic University of Iowa Cesare Tinelli, Francois Bobot New York University

More information

Formally Certified Satisfiability Solving

Formally Certified Satisfiability Solving SAT/SMT Proof Checking Verifying SAT Solver Code Future Work Computer Science, The University of Iowa, USA April 23, 2012 Seoul National University SAT/SMT Proof Checking Verifying SAT Solver Code Future

More information

Combining Static and Dynamic Contract Checking for Curry

Combining Static and Dynamic Contract Checking for Curry Michael Hanus (CAU Kiel) Combining Static and Dynamic Contract Checking for Curry LOPSTR 2017 1 Combining Static and Dynamic Contract Checking for Curry Michael Hanus University of Kiel Programming Languages

More information

OpenMath and SMT-LIB

OpenMath and SMT-LIB James, Matthew England, Roberto Sebastiani & Patrick Trentin 1 Universities of Bath/Coventry/Trento/Trento J.H.@bath.ac.uk 17 July 2017 1 Thanks to EU H2020-FETOPEN-2016-2017-CSA project SC 2 (712689)

More information

Formalization of Incremental Simplex Algorithm by Stepwise Refinement

Formalization of Incremental Simplex Algorithm by Stepwise Refinement Formalization of Incremental Simplex Algorithm by Stepwise Refinement Mirko Spasić, Filip Marić Faculty of Mathematics, University of Belgrade FM2012, 30. August 2012. Overview 1 Introduction 2 Approach

More information

The SMT-LIB 2 Standard: Overview and Proposed New Theories

The SMT-LIB 2 Standard: Overview and Proposed New Theories 1 / 23 The SMT-LIB 2 Standard: Overview and Proposed New Theories Philipp Rümmer Oxford University Computing Laboratory philr@comlab.ox.ac.uk Third Workshop on Formal and Automated Theorem Proving and

More information

COUNTEREXAMPLE-GUIDED MODEL SYNTHESIS

COUNTEREXAMPLE-GUIDED MODEL SYNTHESIS COUNTEREXAMPLE-GUIDED MODEL SYNTHESIS Mathias Preiner, Aina Niemetz and Armin Biere Institute for Formal Models and Verification (FMV) Johannes Kepler University, Linz, Austria http://fmv.jku.at/ TACAS

More information

COUNTEREXAMPLE-GUIDED MODEL SYNTHESIS

COUNTEREXAMPLE-GUIDED MODEL SYNTHESIS COUNTEREXAMPLE-GUIDED MODEL SYNTHESIS Mathias Preiner?y, Aina Niemetz?y and Armin Biere?? Johannes Kepler University y Stanford University SMT Workshop July 22-23, 2017 Heidelberg, Germany Introduction

More information

Runtime Checking and Test Case Generation for Python

Runtime Checking and Test Case Generation for Python Runtime Checking and Test Case Generation for Python Anna Durrer Master Thesis Chair of Programming Methodology D-INFK ETH Supervisor: Marco Eilers, Prof. Peter Müller 24. Mai 2017 1 Introduction This

More information

ArgoSMTExpression: an SMT-LIB 2.0 compliant expression library

ArgoSMTExpression: an SMT-LIB 2.0 compliant expression library ArgoSMTExpression: an SMT-LIB 2.0 compliant expression library Milan Banković milan@matf.bg.ac.rs Faculty of Mathematics, University of Belgrade Abstract. In this paper, we describe our library for handling

More information

COUNTEREXAMPLE-GUIDED MODEL SYNTHESIS

COUNTEREXAMPLE-GUIDED MODEL SYNTHESIS COUNTEREXAMPLE-GUIDED MODEL SYNTHESIS Mathias Preiner, Aina Niemetz and Armin Biere Johannes Kepler University Stanford University SMT Workshop July 22-23, 2017 Heidelberg, Germany Introduction Counterexample-Guided

More information

LEARNING TO INSTANTIATE QUANTIFIERS

LEARNING TO INSTANTIATE QUANTIFIERS LEARNING TO INSTANTIATE QUANTIFIERS Armin Biere 1 joint work with Mathias Preiner 1,2, Aina Niemetz 1,2 TACAS 17, SMT 17, PhD Thesis Mathias Preiner in 2017 1 Johannes Kepler University Linz 2 Stanford

More information

A short manual for the tool Accumulator

A short manual for the tool Accumulator A short manual for the tool Accumulator ZHAO Jianhua State Key Laboratory of Novel Software Technology Dept. of Computer Sci. and Tech. Nanjing University Nanjing, Jiangsu, P.R.China 210093 zhaojh@nju.edu.cn

More information

GNATprove a Spark2014 verifying compiler Florian Schanda, Altran UK

GNATprove a Spark2014 verifying compiler Florian Schanda, Altran UK 1 GNATprove a Spark2014 verifying compiler Florian Schanda, Altran UK Tool architecture User view Source gnatprove Verdict 2 Tool architecture More detailed view... Source Encoding CVC4 gnat2why gnatwhy3

More information

Satisfiability Modulo Theories: ABsolver

Satisfiability Modulo Theories: ABsolver Satisfiability Modulo Theories: ABsolver Michael Tautschnig Joint work with: Andreas Bauer Martin Leucker Christian Schallhart Michael Tautschnig 1 Outline 1. Introduction Michael Tautschnig 2 Outline

More information

Syntax-Guided Program Synthesis. Rajeev Alur. University of Pennsylvania

Syntax-Guided Program Synthesis. Rajeev Alur. University of Pennsylvania Syntax-Guided Program Synthesis Rajeev Alur University of Pennsylvania 1 Goal: Programming computers easier than communicating with people Can programming be liberated, period. David Harel, IEEE Computer,

More information

Syntax-Guided Program Synthesis. Rajeev Alur

Syntax-Guided Program Synthesis. Rajeev Alur Syntax-Guided Program Synthesis Rajeev Alur University of Pennsylvania 1 Goal: Programming computers easier than communicating with people Can programming be liberated, period. David Harel, IEEE Computer,

More information

The SMT-LIB Standard Version 2.0

The SMT-LIB Standard Version 2.0 The SMT-LIB Standard Version 2.0 Clark Barrett 1 Aaron Stump 2 Cesare Tinelli 2 1 New York University, barrett@cs.nyu.edu 2 University of Iowa, astump tinelli@cs.uiowa.edu Abstract The SMT-LIB initiative

More information

Semantics. There is no single widely acceptable notation or formalism for describing semantics Operational Semantics

Semantics. There is no single widely acceptable notation or formalism for describing semantics Operational Semantics There is no single widely acceptable notation or formalism for describing semantics Operational Describe the meaning of a program by executing its statements on a machine, either simulated or actual. The

More information

Software Development. Modular Design and Algorithm Analysis

Software Development. Modular Design and Algorithm Analysis Software Development Modular Design and Algorithm Analysis Precondition and Postcondition To create a good algorithm, a programmer must be able to analyse a precondition (starting state) and a postcondition

More information

Pooya Saadatpanah, Michalis Famelis, Jan Gorzny, Nathan Robinson, Marsha Chechik, Rick Salay. September 30th, University of Toronto.

Pooya Saadatpanah, Michalis Famelis, Jan Gorzny, Nathan Robinson, Marsha Chechik, Rick Salay. September 30th, University of Toronto. Comparing the Pooya Michalis Jan Nathan Marsha Chechik, Rick Salay University of Toronto September 30th, 2012 MoDeVVa 12 1 / 32 in software modeling : pervasive in MDE Models with uncertainty: Represent

More information

Decision Procedures in the Theory of Bit-Vectors

Decision Procedures in the Theory of Bit-Vectors Decision Procedures in the Theory of Bit-Vectors Sukanya Basu Guided by: Prof. Supratik Chakraborty Department of Computer Science and Engineering, Indian Institute of Technology, Bombay May 1, 2010 Sukanya

More information

Alive: Provably Correct InstCombine Optimizations

Alive: Provably Correct InstCombine Optimizations Alive: Provably Correct InstCombine Optimizations David Menendez Santosh Nagarakatte Rutgers University John Regehr University of Utah Nuno Lopes Microsoft Research Can We Trust Compilers? Any large software

More information

Part II. Hoare Logic and Program Verification. Why specify programs? Specification and Verification. Code Verification. Why verify programs?

Part II. Hoare Logic and Program Verification. Why specify programs? Specification and Verification. Code Verification. Why verify programs? Part II. Hoare Logic and Program Verification Part II. Hoare Logic and Program Verification Dilian Gurov Props: Models: Specs: Method: Tool: safety of data manipulation source code logic assertions Hoare

More information

Testing, Fuzzing, & Symbolic Execution

Testing, Fuzzing, & Symbolic Execution Testing, Fuzzing, & Symbolic Execution Software Testing The most common way of measuring & ensuring correctness Input 2 Software Testing The most common way of measuring & ensuring correctness Input Observed

More information

Symbolic and Concolic Execution of Programs

Symbolic and Concolic Execution of Programs Symbolic and Concolic Execution of Programs Information Security, CS 526 Omar Chowdhury 10/7/2015 Information Security, CS 526 1 Reading for this lecture Symbolic execution and program testing - James

More information

Geometric Semantic Genetic Programming ~ Theory & Practice ~

Geometric Semantic Genetic Programming ~ Theory & Practice ~ Geometric Semantic Genetic Programming ~ Theory & Practice ~ Alberto Moraglio University of Exeter 25 April 2017 Poznan, Poland 2 Contents Evolutionary Algorithms & Genetic Programming Geometric Genetic

More information

CVC4 - the SMT Solver

CVC4 - the SMT Solver CVC4 - the SMT Solver Installation on Linux #install make, for example: apt-get install build-essential #install libgmp, for example: apt-get install libgmp-dev #install boost, for example: apt-get install

More information

CMSC 330: Organization of Programming Languages. Formal Semantics of a Prog. Lang. Specifying Syntax, Semantics

CMSC 330: Organization of Programming Languages. Formal Semantics of a Prog. Lang. Specifying Syntax, Semantics Recall Architecture of Compilers, Interpreters CMSC 330: Organization of Programming Languages Source Scanner Parser Static Analyzer Operational Semantics Intermediate Representation Front End Back End

More information

An Annotated Language

An Annotated Language Hoare Logic An Annotated Language State and Semantics Expressions are interpreted as functions from states to the corresponding domain of interpretation Operators have the obvious interpretation Free of

More information

Incremental Proof Development in Dafny

Incremental Proof Development in Dafny 15-414 Lecture 17 1 Instructor: Matt Fredrikson Incremental Proof Development in Dafny TA: Ryan Wagner In this discussion, we ll see in more detail how to go about proving the total correctness of imperative

More information

Rethinking Automated Theorem Provers?

Rethinking Automated Theorem Provers? Rethinking Automated Theorem Provers? David J. Pearce School of Engineering and Computer Science Victoria University of Wellington @WhileyDave http://whiley.org http://github.com/whiley Background Verification:

More information

Evaluating the SMT-LIB repository as a benchmark source for software verification

Evaluating the SMT-LIB repository as a benchmark source for software verification Erasusmus Mundus Summer School 30th June 2015 Evaluating the SMT-LIB repository as a benchmark source for software verification Andrew Healy, MSc Computer Science (by Research) Maynooth University, Ireland

More information

Integration of SMT Solvers with ITPs There and Back Again

Integration of SMT Solvers with ITPs There and Back Again Integration of SMT Solvers with ITPs There and Back Again Sascha Böhme and University of Sheffield 7 May 2010 1 2 Features: SMT-LIB vs. Yices Translation Techniques Caveats 3 4 Motivation Motivation System

More information

SMT-LIB for HOL. Daniel Kroening Philipp Rümmer Georg Weissenbacher Oxford University Computing Laboratory. ITP Workshop MSR Cambridge 25 August 2009

SMT-LIB for HOL. Daniel Kroening Philipp Rümmer Georg Weissenbacher Oxford University Computing Laboratory. ITP Workshop MSR Cambridge 25 August 2009 1 / 13 SMT-LIB for HOL Daniel Kroening Philipp Rümmer Georg Weissenbacher Oxford University Computing Laboratory ITP Workshop MSR Cambridge 25 August 2009 2 / 13 The SMT-LIB Standard SMT Satisfiability

More information

Testing, Debugging, and Verification

Testing, Debugging, and Verification Testing, Debugging, and Verification Formal Specification, Part II Srinivas Pinisetty 23 November 2017 Introduction Today: Introduction to Dafny: An imperative language with integrated support for formal

More information

Lost in translation. Leonardo de Moura Microsoft Research. how easy problems become hard due to bad encodings. Vampire Workshop 2015

Lost in translation. Leonardo de Moura Microsoft Research. how easy problems become hard due to bad encodings. Vampire Workshop 2015 Lost in translation how easy problems become hard due to bad encodings Vampire Workshop 2015 Leonardo de Moura Microsoft Research I wanted to give the following talk http://leanprover.github.io/ Automated

More information

Small Formulas for Large Programs: On-line Constraint Simplification In Scalable Static Analysis

Small Formulas for Large Programs: On-line Constraint Simplification In Scalable Static Analysis Small Formulas for Large Programs: On-line Constraint Simplification In Scalable Static Analysis Isil Dillig, Thomas Dillig, Alex Aiken Stanford University Scalability and Formula Size Many program analysis

More information

Ranking Functions for Loops with Disjunctive Exit-Conditions

Ranking Functions for Loops with Disjunctive Exit-Conditions Ranking Functions for Loops with Disjunctive Exit-Conditions Rody Kersten 1 Marko van Eekelen 1,2 1 Institute for Computing and Information Sciences (icis), Radboud University Nijmegen 2 School for Computer

More information

Genetic improvement of software: a case study

Genetic improvement of software: a case study Genetic improvement of software: a case study Justyna Petke Centre for Research on Evolution, Search and Testing Department of Computer Science, UCL, London Genetic Improvement Programming Automatically

More information

A Decision Procedure for (Co)datatypes in SMT Solvers. Andrew Reynolds Jasmin Christian Blanchette IJCAI sister conference track, July 12, 2016

A Decision Procedure for (Co)datatypes in SMT Solvers. Andrew Reynolds Jasmin Christian Blanchette IJCAI sister conference track, July 12, 2016 A Decision Procedure for (Co)datatypes in SMT Solvers Andrew Reynolds Jasmin Christian Blanchette IJCAI sister conference track, July 12, 2016 Satisfiability Modulo Theories (SMT) Solvers Software Verification

More information

ESC/Java2 vs. JMLForge. Juan Pablo Galeotti, Alessandra Gorla, Andreas Rau Saarland University, Germany

ESC/Java2 vs. JMLForge. Juan Pablo Galeotti, Alessandra Gorla, Andreas Rau Saarland University, Germany ESC/Java2 vs. JMLForge Juan Pablo Galeotti, Alessandra Gorla, Andreas Rau Saarland University, Germany ESC/Java2: the formula is built using Dijsktra s Weakes precondition. Automatic theorem prover: Simplify

More information

Chapter 3 (part 3) Describing Syntax and Semantics

Chapter 3 (part 3) Describing Syntax and Semantics Chapter 3 (part 3) Describing Syntax and Semantics Chapter 3 Topics Introduction The General Problem of Describing Syntax Formal Methods of Describing Syntax Attribute Grammars Describing the Meanings

More information

Refutation-Based Synthesis in SMT

Refutation-Based Synthesis in SMT Noname manuscript No. (will be inserted by the editor) Refutation-Based Synthesis in SMT Andrew Reynolds Viktor Kuncak Cesare Tinelli Clark Barrett Morgan Deters Received: date / Accepted: date Abstract

More information

Programming Languages Third Edition

Programming Languages Third Edition Programming Languages Third Edition Chapter 12 Formal Semantics Objectives Become familiar with a sample small language for the purpose of semantic specification Understand operational semantics Understand

More information

PySMT: a Solver-Agnostic Library for Fast Prototyping of SMT-Based Algorithms

PySMT: a Solver-Agnostic Library for Fast Prototyping of SMT-Based Algorithms 1/14 PySMT: a Solver-Agnostic Library for Fast Prototyping of SMT-Based Algorithms Marco Gario and Andrea Micheli gario@fbk.eu Fondazione Bruno Kessler (FBK) University of Trento 2015-05-04 Interaction

More information

Towards certification of TLA + proof obligations with SMT solvers

Towards certification of TLA + proof obligations with SMT solvers Towards certification of TLA + proof obligations with SMT solvers Stephan Merz and Hernán Vanzetto INRIA Nancy Grand-Est & LORIA Nancy, France Abstract TLA + is a formal specification language that is

More information

Deductive Methods, Bounded Model Checking

Deductive Methods, Bounded Model Checking Deductive Methods, Bounded Model Checking http://d3s.mff.cuni.cz Pavel Parízek CHARLES UNIVERSITY IN PRAGUE faculty of mathematics and physics Deductive methods Pavel Parízek Deductive Methods, Bounded

More information

Reading part: Design-Space Exploration with Alloy

Reading part: Design-Space Exploration with Alloy Reading part: Design-Space Exploration with Alloy Ing. Ken Vanherpen Abstract In the growing world of MDE many tools are offered to describe a (part of a) system, constrain it, and check some properties

More information

Lecture 4. First order logic is a formal notation for mathematics which involves:

Lecture 4. First order logic is a formal notation for mathematics which involves: 0368.4435 Automatic Software Verification April 14, 2015 Lecture 4 Lecturer: Mooly Sagiv Scribe: Nimrod Busany, Yotam Frank Lesson Plan 1. First order logic recap. 2. The SMT decision problem. 3. Basic

More information

URBiVA: Uniform Reduction to Bit-Vector Arithmetic

URBiVA: Uniform Reduction to Bit-Vector Arithmetic URBiVA: Uniform Reduction to Bit-Vector Arithmetic Filip Marić and Predrag Janičić Faculty of Mathematics, Studentski trg 16, 11000 Belgrade, Serbia filip@matf.bg.ac.rs janicic@matf.bg.ac.rs Abstract.

More information

VS 3 : SMT Solvers for Program Verification

VS 3 : SMT Solvers for Program Verification VS 3 : SMT Solvers for Program Verification Saurabh Srivastava 1,, Sumit Gulwani 2, and Jeffrey S. Foster 1 1 University of Maryland, College Park, {saurabhs,jfoster}@cs.umd.edu 2 Microsoft Research, Redmond,

More information

A Fitness Function to Find Feasible Sequences of Method Calls for Evolutionary Testing of Object-Oriented Programs

A Fitness Function to Find Feasible Sequences of Method Calls for Evolutionary Testing of Object-Oriented Programs A Fitness Function to Find Feasible Sequences of Method Calls for Evolutionary Testing of Object-Oriented Programs Myoung Yee Kim and Yoonsik Cheon TR #7-57 November 7; revised January Keywords: fitness

More information

Semantic Subtyping with an SMT Solver

Semantic Subtyping with an SMT Solver Semantic Subtyping with an SMT Solver Cătălin Hrițcu, Saarland University, Saarbrücken, Germany Joint work with Andy Gordon, Gavin Bierman, and Dave Langworthy (all from Microsoft) Refinement Types + Type-test

More information

Complete Instantiation of Quantified Formulas in Satisfiability Modulo Theories. ACSys Seminar

Complete Instantiation of Quantified Formulas in Satisfiability Modulo Theories. ACSys Seminar Complete Instantiation of Quantified Formulas in Satisfiability Modulo Theories Yeting Ge Leonardo de Moura ACSys Seminar 2008.12 Motivation SMT solvers have been successful Quantified smt formulas are

More information

Hoare Logic. COMP2600 Formal Methods for Software Engineering. Rajeev Goré

Hoare Logic. COMP2600 Formal Methods for Software Engineering. Rajeev Goré Hoare Logic COMP2600 Formal Methods for Software Engineering Rajeev Goré Australian National University Semester 2, 2016 (Slides courtesy of Ranald Clouston) COMP 2600 Hoare Logic 1 Australian Capital

More information

Integration of SMT-LIB Support into Maple

Integration of SMT-LIB Support into Maple Integration of SMT-LIB Support into Maple SMT-CAS Integration Some SMT solvers presently incorporate computer algebra techniques in their theory solvers. Examples: verit [3], SMT-RAT [4] Alternate avenue

More information

3.7 Denotational Semantics

3.7 Denotational Semantics 3.7 Denotational Semantics Denotational semantics, also known as fixed-point semantics, associates to each programming language construct a well-defined and rigorously understood mathematical object. These

More information

CSCE 314 TAMU Fall CSCE 314: Programming Languages Dr. Flemming Andersen. Haskell Functions

CSCE 314 TAMU Fall CSCE 314: Programming Languages Dr. Flemming Andersen. Haskell Functions 1 CSCE 314: Programming Languages Dr. Flemming Andersen Haskell Functions 2 Outline Defining Functions List Comprehensions Recursion 3 Conditional Expressions As in most programming languages, functions

More information

Synthesis of Domain Specific Encoders for Bit- Vector Solvers

Synthesis of Domain Specific Encoders for Bit- Vector Solvers Synthesis of Domain Specific Encoders for Bit- Vector Solvers Jeevana Priya Inala! with Rohit Singh, Armando Solar-Lezama To appear at SAT 16 High-level constraint to CNF clauses SMT solver High-level

More information

SMT-Based Bounded Model Checking for Embedded ANSI-C Software. Lucas Cordeiro, Bernd Fischer, Joao Marques-Silva

SMT-Based Bounded Model Checking for Embedded ANSI-C Software. Lucas Cordeiro, Bernd Fischer, Joao Marques-Silva SMT-Based Bounded Model Checking for Embedded ANSI-C Software Lucas Cordeiro, Bernd Fischer, Joao Marques-Silva b.fischer@ecs.soton.ac.uk Bounded Model Checking (BMC) Basic Idea: check negation of given

More information

Integrating a SAT Solver with Isabelle/HOL

Integrating a SAT Solver with Isabelle/HOL Integrating a SAT Solver with / Tjark Weber (joint work with Alwen Tiu et al.) webertj@in.tum.de First Munich-Nancy Workshop on Decision Procedures for Theorem Provers March 6th & 7th, 2006 Integrating

More information

Applications of Logic in Software Engineering. CS402, Spring 2016 Shin Yoo

Applications of Logic in Software Engineering. CS402, Spring 2016 Shin Yoo Applications of Logic in Software Engineering CS402, Spring 2016 Shin Yoo Acknowledgements I borrow slides from: Moonzoo Kim Theo C. Ruys (http://spinroot.com/spin/doc/ SpinTutorial.pdf) CBMC & Daniel

More information

Proving SPARK Verification Conditions with SMT solvers

Proving SPARK Verification Conditions with SMT solvers manuscript No. (will be inserted by the editor) Proving SPARK Verification Conditions with SMT solvers Paul B. Jackson Grant Olney Passmore Received: date / Accepted: date Abstract We have constructed

More information

Abstract Interpretation

Abstract Interpretation Abstract Interpretation Ranjit Jhala, UC San Diego April 22, 2013 Fundamental Challenge of Program Analysis How to infer (loop) invariants? Fundamental Challenge of Program Analysis Key issue for any analysis

More information

1. true / false By a compiler we mean a program that translates to code that will run natively on some machine.

1. true / false By a compiler we mean a program that translates to code that will run natively on some machine. 1. true / false By a compiler we mean a program that translates to code that will run natively on some machine. 2. true / false ML can be compiled. 3. true / false FORTRAN can reasonably be considered

More information

ArgoExpression: SMT-LIB 2.0 compliant expression library

ArgoExpression: SMT-LIB 2.0 compliant expression library inside : SMT-LIB 2.0 compliant expression library Milan Bankovi Filip Mari {milan,filip}@matf.bg.ac.rs Department of Computer Science Faculty of Mathematics University of Belgrade 4th Workshop on Formal

More information

Using Program Synthesis for Program Analysis

Using Program Synthesis for Program Analysis Using Program Synthesis for Program Analysis Cristina David 1, Daniel Kroening 1, and Matt Lewis 1,2 1 University of Oxford 2 Improbable Worlds Ltd. Abstract. In this paper, we propose a unified framework

More information

Andrew Reynolds Liana Hadarean

Andrew Reynolds Liana Hadarean 425,7 3!7441$ 89028147 30,7 #0, 7 9 209.&8 3 $ Andrew Reynolds Liana Hadarean July 15, 2010 1 . 34 0/ 020398 University of Iowa Andrew Reynolds, Cesare Tinelli, Aaron Stump Liana Hadarean, Yeting Ge, Clark

More information

Leonardo de Moura and Nikolaj Bjorner Microsoft Research

Leonardo de Moura and Nikolaj Bjorner Microsoft Research Leonardo de Moura and Nikolaj Bjorner Microsoft Research A Satisfiability Checker with built-in support for useful theories Z3 is a solver developed at Microsoft Research. Development/Research driven by

More information

CHC-COMP Arie Gurfinkel. Philipp Ruemmer, Grigory Fedyukovich, Adrien Champion. 1 st Competition on Solving Constrained Horn Clauses

CHC-COMP Arie Gurfinkel. Philipp Ruemmer, Grigory Fedyukovich, Adrien Champion. 1 st Competition on Solving Constrained Horn Clauses CHC-COMP 2018 Arie Gurfinkel Philipp Ruemmer, Grigory Fedyukovich, Adrien Champion 1 st Competition on Solving Constrained Horn Clauses CHC-COMP: CHC Solving Competition First edition on July 13, 2018

More information

The SMT-LIBv2 Language and Tools: A Tutorial

The SMT-LIBv2 Language and Tools: A Tutorial The SMT-LIBv2 Language and Tools: A Tutorial David R. Cok GrammaTech, Inc. Version 1.2.1 November 23, 2013 The most recent version is available at http://www.grammatech.com/resource/smt/smtlibtutorial.pdf.

More information

Module 3. Requirements Analysis and Specification. Version 2 CSE IIT, Kharagpur

Module 3. Requirements Analysis and Specification. Version 2 CSE IIT, Kharagpur Module 3 Requirements Analysis and Specification Lesson 6 Formal Requirements Specification Specific Instructional Objectives At the end of this lesson the student will be able to: Explain what a formal

More information

Automating Test Driven Development with Grammatical Evolution

Automating Test Driven Development with Grammatical Evolution http://excel.fit.vutbr.cz Automating Test Driven Development with Grammatical Evolution Jan Svoboda* Abstract Test driven development is a widely used process of creating software products with automated

More information

A Tour of CVC4. Tim King

A Tour of CVC4. Tim King A Tour of CVC4 Morgan Deters mdeters@cs.nyu.edu Cesare Tinelli cesare-tinelli@uiowa.edu Tim King tim.king@imag.fr Andrew Reynolds andrew.reynolds@epfl.ch Clark Barrett barrett@cs.nyu.edu ÉC O L E P O L

More information

Searching for Program Invariants using Genetic Programming and Mutation Testing

Searching for Program Invariants using Genetic Programming and Mutation Testing Searching for Program Invariants using Genetic Programming and Mutation Testing Sam Ratcliff, David R. White and John A. Clark. The 13th CREST Open Workshop Thursday 12 May 2011 Outline Invariants Using

More information

Verifying Safety Property of Lustre Programs: Temporal Induction

Verifying Safety Property of Lustre Programs: Temporal Induction 22c181: Formal Methods in Software Engineering The University of Iowa Spring 2008 Verifying Safety Property of Lustre Programs: Temporal Induction Copyright 2008 Cesare Tinelli. These notes are copyrighted

More information

Results and Analysis of SyGuS-Comp 15

Results and Analysis of SyGuS-Comp 15 Results and Analysis of SyGuS-Comp Rajeev Alur Dana Fisman University of Pennsylvania Rishabh Singh Microsoft Research Armando Solar-Lezama Massachusetts Institute of Technology Syntax-Guided Synthesis

More information

Minimum Satisfying Assignments for SMT. Işıl Dillig, Tom Dillig Ken McMillan Alex Aiken College of William & Mary Microsoft Research Stanford U.

Minimum Satisfying Assignments for SMT. Işıl Dillig, Tom Dillig Ken McMillan Alex Aiken College of William & Mary Microsoft Research Stanford U. Minimum Satisfying Assignments for SMT Işıl Dillig, Tom Dillig Ken McMillan Alex Aiken College of William & Mary Microsoft Research Stanford U. 1 / 20 Satisfiability Modulo Theories (SMT) Today, SMT solvers

More information

Chapter 3. Describing Syntax and Semantics

Chapter 3. Describing Syntax and Semantics Chapter 3 Describing Syntax and Semantics Chapter 3 Topics Introduction The General Problem of Describing Syntax Formal Methods of Describing Syntax Attribute Grammars Describing the Meanings of Programs:

More information

Denotational Semantics. Domain Theory

Denotational Semantics. Domain Theory Denotational Semantics and Domain Theory 1 / 51 Outline Denotational Semantics Basic Domain Theory Introduction and history Primitive and lifted domains Sum and product domains Function domains Meaning

More information

Safe Stratified Datalog With Integer Order Does not Have Syntax

Safe Stratified Datalog With Integer Order Does not Have Syntax Safe Stratified Datalog With Integer Order Does not Have Syntax Alexei P. Stolboushkin Department of Mathematics UCLA Los Angeles, CA 90024-1555 aps@math.ucla.edu Michael A. Taitslin Department of Computer

More information

SAT Modulo Bounded Checking

SAT Modulo Bounded Checking SAT Modulo Bounded Checking Simon Cruanes Veridis, Inria Nancy https://cedeela.fr/~simon/ 22nd of June, 2017 Simon Cruanes smbc 22nd of June, 2017 1 / 25 Summary 1 Model Finding in a Computational Logic

More information

1.3. Conditional expressions To express case distinctions like

1.3. Conditional expressions To express case distinctions like Introduction Much of the theory developed in the underlying course Logic II can be implemented in a proof assistant. In the present setting this is interesting, since we can then machine extract from a

More information

SMT Solvers for Verification and Synthesis. Andrew Reynolds VTSA Summer School August 1 and 3, 2017

SMT Solvers for Verification and Synthesis. Andrew Reynolds VTSA Summer School August 1 and 3, 2017 SMT Solvers for Verification and Synthesis Andrew Reynolds VTSA Summer School August 1 and 3, 2017 Acknowledgements Thanks to past and present members of development team of CVC4: Cesare Tinelli, Clark

More information

Principles of Programming Languages

Principles of Programming Languages Principles of Programming Languages www.cs.bgu.ac.il/~ppl172 Collaboration and Management Dana Fisman Lesson 2 - Types with TypeScript 1 Types What are types in programming languages? What types are you

More information

SAT-based Model Checking for C programs

SAT-based Model Checking for C programs SAT-based Model Checking for C programs Moonzoo Kim Provable Software Lab. CS Division of EE 1 Formal Methods Definition in Wikepedia Formal methods are mathematically-based techniques for the specification,

More information

Isabelle/HOL:Selected Features and Recent Improvements

Isabelle/HOL:Selected Features and Recent Improvements /: Selected Features and Recent Improvements webertj@in.tum.de Security of Systems Group, Radboud University Nijmegen February 20, 2007 /:Selected Features and Recent Improvements 1 2 Logic User Interface

More information

3.4 Deduction and Evaluation: Tools Conditional-Equational Logic

3.4 Deduction and Evaluation: Tools Conditional-Equational Logic 3.4 Deduction and Evaluation: Tools 3.4.1 Conditional-Equational Logic The general definition of a formal specification from above was based on the existence of a precisely defined semantics for the syntax

More information

PLDI 2016 Tutorial Automata-Based String Analysis

PLDI 2016 Tutorial Automata-Based String Analysis PLDI 2016 Tutorial Automata-Based String Analysis Tevfik Bultan, Abdulbaki Aydin, Lucas Bang Verification Laboratory http://vlab.cs.ucsb.edu Department of Computer Science Common Usages of Strings } Input

More information

Faculty of Engineering Computer Engineering Department Islamic University of Gaza C++ Programming Language Lab # 6 Functions

Faculty of Engineering Computer Engineering Department Islamic University of Gaza C++ Programming Language Lab # 6 Functions Faculty of Engineering Computer Engineering Department Islamic University of Gaza 2013 C++ Programming Language Lab # 6 Functions C++ Programming Language Lab # 6 Functions Objective: To be familiar with

More information

CAV Verification Mentoring Workshop 2017 SMT Solving

CAV Verification Mentoring Workshop 2017 SMT Solving CAV Verification Mentoring Workshop 2017 SMT Solving Alberto Griggio Fondazione Bruno Kessler Trento, Italy The SMT problem Satisfiability Modulo Theories Given a (quantifier-free) FOL formula and a (decidable)

More information