Topic 3: MiniZinc (Version of 10th November 2015)

Size: px
Start display at page:

Download "Topic 3: MiniZinc (Version of 10th November 2015)"

Transcription

1 Topic 3: (Version of 10th November 2015) Jean-Noël Monette ASTRA Research Group on Combinatorial Optimisation Uppsala University Sweden Course 1DL449: for Combinatorial Optimisation

2 Outline Course 1DL for Combinatorial Optimisation

3 Overview is a declarative language to model combinatorial problems using constraints. supports the separation of the model the data. A couple (model, data) is called an instance. A instance is solved by: 1 Compiling the instance into a FlatZinc model. 2 Solving the FlatZinc model using one of many existing backend solvers. Course 1DL for Combinatorial Optimisation

4 Model A model is comprised of the following items: Parameter declarations Variable declarations Predicate declarations Function declarations s Objective Output comm Course 1DL for Combinatorial Optimisation

5 Model A model is comprised of the following items: Parameter declarations Variable declarations Predicate declarations Function declarations s Objective Output comm Note: uses the word parameter for any constant identifier. We follow their terminology in this topic. Course 1DL for Combinatorial Optimisation

6 Types for Parameters is strongly typed offers the following types for parameters: int: integer bool: Boolean float: floating-point number (not covered further) string: string of characters set of τ: set of elements of type τ, with τ being int, bool, float, or string array[ρ] of τ: possibly multidimensional array of elements of type τ (anything except array). The range ρ is an integer interval l..u in each dimension. The declaration int: N declares a parameter of type integer with name N. One can also write par int: N to stress that it is a parameter. Course 1DL for Combinatorial Optimisation

7 Types for Variables Variables are declared by prefixing var to the type, e.g., var int: N declares a variable N that must be assigned an integer value. The only variable types are: int bool float (not covered further) set of int One can also have arrays of elements of any variable type. Course 1DL for Combinatorial Optimisation

8 Subtyping Parameters (par) can be used whenever a var is expected. This extends to arrays: A function expecting an array[int] of var int can be passed an array[int] of int. The types bool int are two distinct types. One can coerce from bool to int using the function bool2int. This coercion is automatic but, for clarity, should be made explicit. Course 1DL for Combinatorial Optimisation

9 Option Variables supports option variables. An option variable is a variable that can also take the special value. A variable is declared optional with the keyword opt. For example, var opt 1..4: x; declares a variable that can take values in {1, 2, 3, 4} { }. We will not cover the use of option variables in this course. However, one can meet them: in the documentation: var int is a subtype of var opt int, in error messages: this is probably a sign that your model is too complicated. Course 1DL for Combinatorial Optimisation

10 Declaring Parameters Variables 1 int: N = 4; 2 int: M; 3 M = 10; 4 set of int: prime = {2,3,5,7,11,13}; 5 var int: X; 6 var 0..59: minute = X + N; 7 var set of prime: taken; All parameters must be given a fixed value, but declaration assignment can be separated. Variables can be constrained at declaration. The domain of a variable can be restricted by replacing the type declaration by a set of values of that type: X can take any integer value. minute must take an integer value between taken must be a subset of {2,3,5,7,11,13}. Course 1DL for Combinatorial Optimisation

11 Literals Boolean: true false Integers: In decimal, hexadecimal, or octal format Sets: Between braces: {1,3,5}, or as intervals Arrays: Between square brackets: [6,3,1,7] 2D arrays: A vertical bar is used before, between, after each row: [ 11,12,13,14 21,22,23,24 31,32,33,34 ] No special literals for arrays of higher dimensions. Note: The indices of arrays start at 1 by default. Course 1DL for Combinatorial Optimisation

12 Array Set Comprehensions Arrays sets can be built with comprehensions using the notations [σ γ] {σ γ} where σ is an expression evaluated for each element generated by the generator γ. The generator introduces one or more identifiers with values drawn from one or more sets of integers, optionally followed by a test. 1 [x * 2 x in 1..8] = [2,4,6,8,10,12,14,16] 2 [x + 2*y x in 1..3, y in 1..4] = [3,5,7,9,4,6,8,10,5,7,9,11] 3 [x * y x, y in 1..3 where x < y] = [2,3,6] 4 {x + 2*y x in 1..3, y in 1..4} = {3,4,5,6,7,8,9,10,11} Course 1DL for Combinatorial Optimisation

13 Iteration Syntactic Sugar sum(i, j in 1..5)(i*j) is syntactic sugar for: sum([i*j i, j in 1..5]) This works for any function or predicate that takes an array as unique argument. Course 1DL for Combinatorial Optimisation

14 Iteration Syntactic Sugar sum(i, j in 1..5)(i*j) is syntactic sugar for: sum([i*j i, j in 1..5]) This works for any function or predicate that takes an array as unique argument. In particular: forall(i in 1..9)(x[i+1] = x[i] + y[i]) is syntactic sugar for: forall([x[i+1] = x[i] + y[i] i in 1..9]) forall(array[int] of var bool: b) is a predicate that is true if all the variables in b are true. Course 1DL for Combinatorial Optimisation

15 Array Manipulation Changing array dimensions ranges (the numbers of elements must match): array1d(5..10,[ 3,2 5,4 6,1 ]) Indices start at 5. array2d(1..2,1..3,[2,7,3,7,4,9]) Tip: Try to keep your ranges starting at 1. It is simpler to read a model that follows the usual convention. There has been some subtle bugs when arrays are not indexed from 1. Concatenation: [1,2] ++ [3,4] Course 1DL for Combinatorial Optimisation

16 s A constraint is the constraint keyword followed by a Boolean expression that must be true in any solution. constraint x < y; constraint sum(q) = 0 /\ alldifferent(q); constraint if x < y then x = y else x > y endif; Course 1DL for Combinatorial Optimisation

17 s A constraint is the constraint keyword followed by a Boolean expression that must be true in any solution. constraint x < y; constraint sum(q) = 0 /\ alldifferent(q); constraint if x < y then x = y else x > y endif; What does the following mean? constraint x = x + 1; Course 1DL for Combinatorial Optimisation

18 s A constraint is the constraint keyword followed by a Boolean expression that must be true in any solution. constraint x < y; constraint sum(q) = 0 /\ alldifferent(q); constraint if x < y then x = y else x > y endif; What does the following mean? constraint x = x + 1; Minizinc is a declarative language: this line is unsatisfiable. Course 1DL for Combinatorial Optimisation

19 Objective The solve item gives the objective of the problem: solve satisfy; The problem is a satisfaction problem. solve minimize x; The objective is to minimise the value of variable x. solve maximize abs(x)* y; The objective is to maximise the value of expression abs(x)* y. Course 1DL for Combinatorial Optimisation

20 Objective The solve item gives the objective of the problem: solve satisfy; The problem is a satisfaction problem. solve minimize x; The objective is to minimise the value of variable x. solve maximize abs(x)* y; The objective is to maximise the value of expression abs(x)* y. does not have direct support for multi-objective optimisation: either multiple objectives must be aggregated as a weithted sum, or the multi-objective nature must be hled outside of. Course 1DL for Combinatorial Optimisation

21 Output The output item describes what must be printed upon finding a solution. The keyword output is followed by an array of strings. output [show(x)]; output ["solution:"] ++ [if x[i] > 0 then show(2 * x[i]) ++ ", " else "_, " endif i in 1..10]; The function show returns a string representing the value of the given expression. The operator ++ concatenates two strings or two arrays. "x = \(x), " is equivalent to "x = "++show(x)++", ". Course 1DL for Combinatorial Optimisation

22 Tests Conditional: if θ then φ 1 else φ 2 endif Generator: [x x in ρ where θ ] The expressions φ 1 φ 2 must have the same type. Note that the Boolean expression θ can depend on the values of variables. With great power comes great responsibility. (see Section 4) Course 1DL for Combinatorial Optimisation

23 Operators Boolean: not, /\, \/, <->, ->, <-, xor, forall, exists, xorall, iffall, clause, bool2int Integer: +, -, *, div, mod, abs, pow, min, max, sum, product, =, <, <=, =>, >,!=,.. Sets: union, intersect, diff, symdiff, card, in, subset, superset, set2array, array_union, array_intersect Strings: ++, concat, join Arrays: length, index_set, index_set_1of2, index_set_2of2,..., index_set_6of6, array1d, array2d,..., array6d Course 1DL for Combinatorial Optimisation

24 remarks The order of model items does not matter. One can include other files: include "globals.mzn"; The following functions are useful for debugging models: Assert: assert(θ,"error message", φ). If the constant expression θ is false, aborts with the error message, otherwise returns φ. Trace: trace("message", φ). Prints the message returns φ. Course 1DL for Combinatorial Optimisation

25 Outline Course 1DL for Combinatorial Optimisation

26 offers a large collection of predefined functions predicates to increase the level at which models are described (see Topic 4: s). It is also possible for the modellers to define their own functions predicates. Course 1DL for Combinatorial Optimisation

27 Function Predicate Declarations 1 function int: double(int: x) ; 2 function var int: double(var int: x) ; 3 4 predicate positive(var int: x) ; 5 function var bool: negative(var int: x); are functions returning a var bool. Function ( hence predicate) names can be overloaded. Course 1DL for Combinatorial Optimisation

28 Function Definitions Akin to functional programming, the body of a function is an expression of the same type as the returned value. 1 function int: double(int: x) = 2 * x; 2 function var int: double(var int: x) = 2 * x; 3 4 predicate positive(var int: x) = x > 0; 5 function var bool: negative(var int: x)= x < 0; Possible to use if then else endif, forall, exists. Course 1DL for Combinatorial Optimisation

29 Let Expressions One can introduce local identifiers with a let expression constrain them. 1 function int: double(int: x) = 2 let { int: y = 2 * x; } in y; 3 4 function var int: double(var int: x) = 5 let { var int: y = 2 * x; } in y; 6 7 function var int: double(var int: x) = 8 let { var int: y; 9 constraint y = 2 * x; 10 } in y ; The second third functions are equivalent each invocation introduces a new (existentially quantified) variable into the model. Course 1DL for Combinatorial Optimisation

30 s in Let Expressions What is the difference between the following two definitions? 1 predicate positiveprod(var int: x, var int: y)= 2 let { var int: z; constraint z = x * y; 3 } in z > 0; 4 5 predicate positiveprod(var int: x, var int: y)= 6 let { var int: z; 7 } in z = x * y /\ z > 0; Course 1DL for Combinatorial Optimisation

31 s in Let Expressions What is the difference between the following two definitions? 1 predicate positiveprod(var int: x, var int: y)= 2 let { var int: z; constraint z = x * y; 3 } in z > 0; 4 5 predicate positiveprod(var int: x, var int: y)= 6 let { var int: z; 7 } in z = x * y /\ z > 0; Their behaviour is different in a negative context, e.g., not positiveprod(a,b): The first one then ensures a * b = z /\ z <= 0 The second one then ensures a * b!= z \/ z <= 0 The second one leaves a b unconstrained. Course 1DL for Combinatorial Optimisation

32 Using There are many advantages to using functions predicates in a model: Software engineering good practice: Reusability Readability Modularity The model might be solved more efficiently: Better common subexpression elimination Definitions can be solver-specific Course 1DL for Combinatorial Optimisation

33 Outline Course 1DL for Combinatorial Optimisation

34 Some examples by Guido Tack Course 1DL for Combinatorial Optimisation

35 Zinc Essence Essence OPL see IBM website AIMMS GAMS AMPL Mosel-Xpress see FICO website SMT-LIB Course 1DL for Combinatorial Optimisation

36 Outline Course 1DL for Combinatorial Optimisation

37 Solving a Model Two phases: 1 Compile (or flatten) the model into a solver-specific FlatZinc model 2 Interpret the FlatZinc model with a constraint solver, also called backend FlatZinc is a low-level subset of : No quantifiers or array comprehensions No function calls Only built-in constraint predicates of the targeted solver Only variables of types supported by the targeted solver s only on (arrays of) variables parameters Course 1DL for Combinatorial Optimisation

38 Unroll all quantifiers array comprehensions Inline all function predicate calls Evaluate all expressions not depending on the value of a variable Replace unsupported variable types Decompose complex expressions, introducing new variables Course 1DL for Combinatorial Optimisation

39 Unroll all quantifiers array comprehensions Inline all function predicate calls Evaluate all expressions not depending on the value of a variable Replace unsupported variable types Decompose complex expressions, introducing new variables produces solver-specific models: Not all solvers have the same set of built-in constraint predicates Different solvers may use different function constraint predicate definitions. Course 1DL for Combinatorial Optimisation

40 : Examples 1 constraint forall(i in 1..4)( 2 x[i] = i 3 ); Course 1DL for Combinatorial Optimisation

41 : Examples 1 constraint forall(i in 1..4)( 2 x[i] = i 3 ); 1 constraint forall([x[i] = i i in 1..4]); Course 1DL for Combinatorial Optimisation

42 : Examples 1 constraint forall(i in 1..4)( 2 x[i] = i 3 ); 1 constraint forall([x[i] = i i in 1..4]); 1 constraint forall([x[1]=1,x[2]=2,x[3]=3,x[4]=4]); Course 1DL for Combinatorial Optimisation

43 : Examples 1 constraint forall(i in 1..4)( 2 x[i] = i 3 ); 1 constraint forall([x[i] = i i in 1..4]); 1 constraint forall([x[1]=1,x[2]=2,x[3]=3,x[4]=4]); 1 constraint x[1]=1 /\ x[2]=2 /\ x[3]=3 /\ x[4]=4; Course 1DL for Combinatorial Optimisation

44 : Examples 1 constraint forall(i in 1..4)( 2 x[i] = i 3 ); 1 constraint forall([x[i] = i i in 1..4]); 1 constraint forall([x[1]=1,x[2]=2,x[3]=3,x[4]=4]); 1 constraint x[1]=1 /\ x[2]=2 /\ x[3]=3 /\ x[4]=4; 1 constraint x[1]=1; 2 constraint x[2]=2; 3 constraint x[3]=3; 4 constraint x[4]=4; Course 1DL for Combinatorial Optimisation

45 : Examples (2) 1 int: x = 4; 2 var 0..10: y; 3 constraint if x < 8 then y < x 4 else y = x + 1 endif; Course 1DL for Combinatorial Optimisation

46 : Examples (2) 1 int: x = 4; 2 var 0..10: y; 3 constraint if x < 8 then y < x 4 else y = x + 1 endif; 1 var 0..10: y; 2 constraint if 4 < 8 then y < 4 3 else y = endif; Course 1DL for Combinatorial Optimisation

47 : Examples (2) 1 int: x = 4; 2 var 0..10: y; 3 constraint if x < 8 then y < x 4 else y = x + 1 endif; 1 var 0..10: y; 2 constraint if 4 < 8 then y < 4 3 else y = endif; 1 var 0..10: y; 2 constraint y < 4; Course 1DL for Combinatorial Optimisation

48 : Examples (2) 1 int: x = 4; 2 var 0..10: y; 3 constraint if x < 8 then y < x 4 else y = x + 1 endif; 1 var 0..10: y; 2 constraint if 4 < 8 then y < 4 3 else y = endif; 1 var 0..10: y; 2 constraint y < 4; 1 var 0..3: y; Course 1DL for Combinatorial Optimisation

49 : Examples (3) 1 var 0..10: x; 2 var 0..10: y; 3 constraint if x < 8 then y < x 4 else y = x + 1 endif; Course 1DL for Combinatorial Optimisation

50 : Examples (3) 1 var 0..10: x; 2 var 0..10: y; 3 constraint if x < 8 then y < x 4 else y = x + 1 endif; 3 var bool: b1; 4 var bool: b2; 5 var bool: b3; 6 constraint b1 = (x < 8); 7 constraint b2 = (y < x); 8 constraint b3 = (y = x + 1); 9 constraint if b1 then b2 else b3 endif; Course 1DL for Combinatorial Optimisation

51 : Examples (3) 1 var 0..10: x; 2 var 0..10: y; 3 constraint if x < 8 then y < x 4 else y = x + 1 endif; 3 var bool: b1; 4 var bool: b2; 5 var bool: b3; 6 constraint b1 = (x < 8); 7 constraint b2 = (y < x); 8 constraint b3 = (y = x + 1); 9 constraint if b1 then b2 else b3 endif; 9 constraint b1 -> b2; 10 constraint (not b1) -> b3; Course 1DL for Combinatorial Optimisation

52 : Examples (3) 1 var 0..10: x; 2 var 0..10: y; 3 var bool: b1; 4 var bool: b2; 5 var bool: b3; 6 constraint b1 = (x < 8); 7 constraint b2 = (y < x); 8 constraint b3 = (y = x + 1); 9 constraint b1 -> b2; 10 constraint b1 \/ b3; Course 1DL for Combinatorial Optimisation

53 : Examples (3) 1 var 0..10: x; 2 var 0..10: y; 3 var bool: b1; 4 var bool: b2; 5 var bool: b3; 6 constraint b1 = (x < 8); 7 constraint b2 = (y < x); 8 constraint b3 = (y = x + 1); 9 constraint b1 -> b2; 10 constraint b1 \/ b3; 6 constraint int_lt_reif(x,8,b1); 7 constraint int_lt_reif(y,x,b2); 8 constraint int_lin_eq_reif([1,-1],[y,x],1,b3); 9 constraint bool_imply(b1,b2); 10 constraint array_bool_or([b1,b3],true); Course 1DL for Combinatorial Optimisation

54 Outline Course 1DL for Combinatorial Optimisation

55 MZN model FZN model MZN data mzn2fzn backend solution Course 1DL for Combinatorial Optimisation

56 MZN model MZN data MZN solution mzn2fzn FZN model output specification solns2out backend FZN solution Course 1DL for Combinatorial Optimisation

57 MZN model MZN data MZN solution PP definitions FZN model mzn2fzn output specification solns2out backend FZN solution PP: predefined predicates Course 1DL for Combinatorial Optimisation

58 MZN model MZN data MZN solution PP definitions for backend X mzn2fzn FZN model for backend X output specification solns2out backend X FZN solution PP: predefined predicates Course 1DL for Combinatorial Optimisation

59 MZN model MZN data MZN solution PP PPdefinitions for for backend GecodeX mzn2fzn FZN FZNmodel for forbackend GecodeX output specification solns2out backend fzn-gecode X FZN solution Course 1DL for Combinatorial Optimisation

60 MZN model PP PPdefinitions for for backend GecodeX FZN FZNmodel for forbackend GecodeX MZN data mzn2fzn output specification MZN solution mzn-gecode solns2out backend fzn-gecode X FZN solution Course 1DL for Combinatorial Optimisation

61 MZN model MZN data MZN solution PP PPdefinitions PPdefinitions for for backend GecodeX for fzn2smt mzn2fzn mzn2smt FZN FZN model FZNmodel for forbackend GecodeX fzn2smt output specification solns2out backend fzn-gecode X fzn2smt FZN solution Course 1DL for Combinatorial Optimisation

62 : Model Once, Solve Everywhere MZN model MZN data MZN solution PP PPdefinitions PPdefinitions forpp for backend definitions GecodeX for fzn2smt for... mzn2fzn mzn-... FZN FZN model FZNmodel forfzn forbackend model GecodeX fzn2smt for... output specification solns2out backend fzn-gecode X fzn2smt fzn-... FZN solution Course 1DL for Combinatorial Optimisation

63 Solvers programming CP: Gecode, SICStus Prolog, Choco, Google or-tools, JaCoP, Mistral,... Lazy-clause generation LCG: Opturion CPX, Chuffed, G12/CPX,... Mixed Integer programming MIP: G12/MIP, CPLEX, Gurobi,... Local search metaheuristics LS: OscaR/CBLS, EasyLocal++, YACS,... SAT: G12/SAT,... SAT modulo theories SMT: fzn2smt with Yices 2,... Hybrids: izplus, Minisat(ID),... Portfolios of solvers: sunny-cp,... Course 1DL for Combinatorial Optimisation

64 Solvers programming CP: Gecode, SICStus Prolog, Choco, Google or-tools, JaCoP, Mistral,... Lazy-clause generation LCG: Opturion CPX, Chuffed, G12/CPX,... Mixed Integer programming MIP: G12/MIP, CPLEX, Gurobi,... Local search metaheuristics LS: OscaR/CBLS, EasyLocal++, YACS,... SAT: G12/SAT,... SAT modulo theories SMT: fzn2smt with Yices 2,... Hybrids: izplus, Minisat(ID),... Portfolios of solvers: sunny-cp,... Solvers provided with the virtual machine are in red. Course 1DL for Combinatorial Optimisation

65 Example: Pigeonhole Problem Example (Pigeonhole) Place n pigeons into n 1 holes so that all pigeons are placed no two pigeons are placed in the same hole. This problem is trivially unfeasible. We will use this problem to show: how different solvers have different definitions for the same predicate; that it is often important for efficiency to use predefined predicates. Course 1DL for Combinatorial Optimisation

66 Pigeonhole Models Using ALLDIFFERENT 1 int: n; 2 array[1..n] of var 1..(n-1): hole; 3 constraint alldifferent(hole); 4 solve satisfy; Using binary disequalities 1 int: n; 2 array[1..n] of var 1..(n-1): hole; 3 constraint forall(p1 in 1..n, p2 in i+1..n) 4 (hole[p1]!= hole[p2]); 5 solve satisfy; Course 1DL for Combinatorial Optimisation

67 Predicate Definitions mzn-gecode predicate all_different_int (array[int] of var int: x); predicate int_ne(var int: x, var int: y); mzn2smt predicate all_different_int (array[int] of var int: x) = forall(i,j in index_set(x) where i < j) ( x[i]!= x[j] ); predicate int_ne(var int: x, var int: y); Course 1DL for Combinatorial Optimisation

68 mzn-g12mip predicate all_different_int (array[int] of var int: x) = let { array[int,int] of var 0..1: x_eq_d = eq_encode(x) } in forall(d in index_set_2of2(x_eq_d)) ( sum(i in index_set_1of2(x_eq_d)) ( x_eq_d[i,d] ) <= 1 ); predicate int_ne(var int: x, var int: y) = let { var 0..1: p } in x - y + 1 <= ub(x - y + 1) * (1 - p) /\ y - x + 1 <= ub(y - x + 1) * p; Course 1DL for Combinatorial Optimisation

69 mzn-g12mip (end) function array[int,int] of var int: eq_encode (array[int] of var int: x) = [...] predicate equality_encoding(var int: x, array[int] of var 0..1: x_eq_d) = x in index_set(x_eq_d) /\ sum(d in index_set(x_eq_d))(x_eq_d[d]) = 1 /\ sum(d in index_set(x_eq_d))(d*x_eq_d[d])=x; Course 1DL for Combinatorial Optimisation

70 Experimental Comparison Time in seconds to prove unsatisfiability: n = 10 ALLDIFFERENT disequalities mzn-gecode < 1 1 mzn-g12mip < mzn2smt Course 1DL for Combinatorial Optimisation

71 Experimental Comparison Time in seconds to prove unsatisfiability: n = 10 ALLDIFFERENT disequalities mzn-gecode < 1 1 mzn-g12mip < mzn2smt mzn-gecode with disequalities: n = 11: 12 sec. n = 12: 153 sec. mzn-gecode with ALLDIFFERENT: n = 11: < 1 sec. n = 100: < 1 sec. n = : 2 sec. mzn-g12mip with ALLDIFFERENT: n = 11: < 1 sec. n = 100: 3 sec. n = 300: 35 sec. Course 1DL for Combinatorial Optimisation

Topic 2: Basic Modelling (Version of 30th January 2018)

Topic 2: Basic Modelling (Version of 30th January 2018) Topic 2: Basic (Version of 30th January 2018) Pierre Flener and Jean-Noël Monette Optimisation Group Department of Information Technology Uppsala University Sweden Course 1DL448: for Combinatorial Optimisation

More information

Constraint Programming

Constraint Programming Constraint Programming Justin Pearson Uppsala University 1st July 2016 Special thanks to Pierre Flener, Joseph Scott and Jun He Outline 1 Introduction to Constraint Programming (CP) 2 Introduction to MiniZinc

More information

Course Summary! What have we learned and what are we expected to know?

Course Summary! What have we learned and what are we expected to know? Course Summary! What have we learned and what are we expected to know? Overview! Introduction Modelling in MiniZinc Finite Domain Constraint Solving Search Linear Programming and Network Flow Mixed Integer

More information

There are no CNF problems. Peter J. Stuckey and countless others!

There are no CNF problems. Peter J. Stuckey and countless others! There are no CNF problems Peter J. Stuckey and countless others! Conspirators Ignasi Abio, Ralph Becket, Sebastian Brand, Geoffrey Chu, Michael Codish, Greg Duck, Nick Downing, Thibaut Feydy, Graeme Gange,

More information

There are no CNF problems. Peter J. Stuckey and countless others!

There are no CNF problems. Peter J. Stuckey and countless others! There are no CNF problems Peter J. Stuckey and countless others! Conspirators Ignasi Abio, Ralph Becket, Sebastian Brand, Geoffrey Chu, Michael Codish, Greg Duck, Nick Downing, Thibaut Feydy, Graeme Gange,

More information

Specification of Zinc and MiniZinc. Nicholas Nethercote Kim Marriott Reza Rafeh Mark Wallace María García de la Banda Version 0.8

Specification of Zinc and MiniZinc. Nicholas Nethercote Kim Marriott Reza Rafeh Mark Wallace María García de la Banda Version 0.8 Specification of Zinc and MiniZinc Nicholas Nethercote Kim Marriott Reza Rafeh Mark Wallace María García de la Banda Version 0.8 1 Contents 1 Introduction [ZM] 3 1.1 Zinc [Z]..................................

More information

Constraint Modeling. with MiniZinc. Jakub Bulín. Department of CU Prague

Constraint Modeling. with MiniZinc. Jakub Bulín. Department of CU Prague Constraint Modeling with MiniZinc Jakub Bulín Department of Algebra @ CU Prague Table of contents 1. Intro & the theory part 2. An overview of MinZinc 3. Examples of constraint models 4. Learn more 1 In

More information

Specification of FlatZinc. Nicholas Nethercote Version 0.8.1

Specification of FlatZinc. Nicholas Nethercote Version 0.8.1 Specification of FlatZinc Nicholas Nethercote Version 0.8.1 1 Contents 1 Introduction 3 2 Overview of a Model 3 2.1 Specifying a Problem........................... 3 2.2 Evaluation of a Model Instance.....................

More information

There are no CNF problems. Peter J. Stuckey and countless others!

There are no CNF problems. Peter J. Stuckey and countless others! There are no CNF problems Peter J. Stuckey and countless others! Conspirators Ignasi Abio, Ralph Becket, Sebastian Brand, Geoffrey Chu, Michael Codish, Greg Duck, Nick Downing, Thibaut Feydy, Graeme Gange,

More information

MiniZinc Tutorial. Ralph Becket 18 June The G12 project defines three closely related modelling languages:

MiniZinc Tutorial. Ralph Becket 18 June The G12 project defines three closely related modelling languages: MiniZinc Tutorial Ralph Becket rafe@csse.unimelb.edu.au 18 June 2007 1 Modelling in MiniZinc The G12 project defines three closely related modelling languages: Zinc is a very high level modelling language;

More information

Specification of FlatZinc

Specification of FlatZinc Specification of FlatZinc Version 1.4 Ralph Becket 1 Contents 1 Introduction 3 2 Comments 3 3 Types 3 3.1 Parameter types..................................... 3 3.2 Variable types.......................................

More information

Modelling. Christina Burt, Stephen J. Maher, Jakob Witzig. 29th September Zuse Institute Berlin Berlin, Germany

Modelling. Christina Burt, Stephen J. Maher, Jakob Witzig. 29th September Zuse Institute Berlin Berlin, Germany Modelling Christina Burt, Stephen J. Maher, Jakob Witzig Zuse Institute Berlin Berlin, Germany 29th September 2015 Modelling Languages Jakob Witzig Burt, Maher, Witzig Modelling 1 / 22 Modelling Languages:

More information

Modelling with Constraints

Modelling with Constraints Masterclass Modelling with Constraints Part 1: Introduction Alan M Frisch Artificial Intelligence Group Dept of Computer Science University of York 12 December 2011 1 Motivation A modern generation of

More information

NOTATION AND TERMINOLOGY

NOTATION AND TERMINOLOGY 15.053x, Optimization Methods in Business Analytics Fall, 2016 October 4, 2016 A glossary of notation and terms used in 15.053x Weeks 1, 2, 3, 4 and 5. (The most recent week's terms are in blue). NOTATION

More information

Constraint Programming in Practice

Constraint Programming in Practice Outline DM87 SCHEDULING, TIMETABLING AND ROUTING Lecture 7 Constraint Programming in Practice Marco Chiarandini DM87 Scheduling, Timetabling and Routing 2 Outline Constraint Programming Systems CP systems

More information

Modelling Constrained Optimization Problems! How can we formally describe a constrained optimization problem in order to solve it

Modelling Constrained Optimization Problems! How can we formally describe a constrained optimization problem in order to solve it Modelling Constrained Optimization Problems! How can we formally describe a constrained optimization problem in order to solve it Overview! Different approaches to modelling constrained optimization problems

More information

The Design of the Zinc Modelling Language

The Design of the Zinc Modelling Language The Design of the Zinc Modelling Language KIM MARRIOTT kim.marriott@infotech.monash.edu.au Clayton School of IT, Monash University, Vic. 3800, Australia NICHOLAS NETHERCOTE National ICT Australia, Melbourne,

More information

CSE 20 DISCRETE MATH. Fall

CSE 20 DISCRETE MATH. Fall CSE 20 DISCRETE MATH Fall 2017 http://cseweb.ucsd.edu/classes/fa17/cse20-ab/ Final exam The final exam is Saturday December 16 11:30am-2:30pm. Lecture A will take the exam in Lecture B will take the exam

More information

Data types for mcrl2

Data types for mcrl2 Data types for mcrl2 Aad Mathijssen April 5, 2018 We provide a syntax for the standard data types of the mcrl2 language. This syntax is intended to be a practical mix between standard mathematical notation

More information

Hybrid Constraint Solvers

Hybrid Constraint Solvers Hybrid Constraint Solvers - An overview Why Hybrid Solvers CP and SAT: Lazy Clause Generation CP and LP: Reification of Linear Constraints Conclusions 9 November 2011 Pedro Barahona - EPCL - Hybrid Solvers

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

Java is an objet-oriented programming language providing features that support

Java is an objet-oriented programming language providing features that support Java Essentials CSCI 136: Spring 2018 Handout 2 February 2 Language Basics Java is an objet-oriented programming language providing features that support Data abstraction Code reuse Modular development

More information

CS 4240: Compilers and Interpreters Project Phase 1: Scanner and Parser Due Date: October 4 th 2015 (11:59 pm) (via T-square)

CS 4240: Compilers and Interpreters Project Phase 1: Scanner and Parser Due Date: October 4 th 2015 (11:59 pm) (via T-square) CS 4240: Compilers and Interpreters Project Phase 1: Scanner and Parser Due Date: October 4 th 2015 (11:59 pm) (via T-square) Introduction This semester, through a project split into 3 phases, we are going

More information

CSE 20 DISCRETE MATH. Winter

CSE 20 DISCRETE MATH. Winter CSE 20 DISCRETE MATH Winter 2017 http://cseweb.ucsd.edu/classes/wi17/cse20-ab/ Final exam The final exam is Saturday March 18 8am-11am. Lecture A will take the exam in GH 242 Lecture B will take the exam

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

Appendix. Grammar. A.1 Introduction. A.2 Keywords. There is no worse danger for a teacher than to teach words instead of things.

Appendix. Grammar. A.1 Introduction. A.2 Keywords. There is no worse danger for a teacher than to teach words instead of things. A Appendix Grammar There is no worse danger for a teacher than to teach words instead of things. Marc Block Introduction keywords lexical conventions programs expressions statements declarations declarators

More information

Converting MiniZinc to FlatZinc

Converting MiniZinc to FlatZinc Converting MiniZinc to FlatZinc Version 1.6 Nicholas Nethercote 1 Introduction This document specifies how to convert MiniZinc to FlatZinc. We will use the MiniZinc model and example data for a restricted

More information

Type Checking. Outline. General properties of type systems. Types in programming languages. Notation for type rules.

Type Checking. Outline. General properties of type systems. Types in programming languages. Notation for type rules. Outline Type Checking General properties of type systems Types in programming languages Notation for type rules Logical rules of inference Common type rules 2 Static Checking Refers to the compile-time

More information

Outline. General properties of type systems. Types in programming languages. Notation for type rules. Common type rules. Logical rules of inference

Outline. General properties of type systems. Types in programming languages. Notation for type rules. Common type rules. Logical rules of inference Type Checking Outline General properties of type systems Types in programming languages Notation for type rules Logical rules of inference Common type rules 2 Static Checking Refers to the compile-time

More information

Initial Specification of Zinc 0.1

Initial Specification of Zinc 0.1 Initial Specification of Zinc 0.1 Kim Marriott Reza Rafeh Mark Wallace Maria Garcia de la Banda February 15, 2006 1 Introduction Zinc is a new modelling language which provides: mathematical notation like

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

Half Reification and Flattening

Half Reification and Flattening Half Reification and Flattening Thibaut Feydy 1, Zoltan Somogyi 1, and Peter J. Stuckey 1 National ICT Australia and the University of Melbourne, Victoria, Australia {tfeydy,zs,pjs}@csse.unimelb.edu.au

More information

Example problems. Combinatorial auction. Towers of Hanoi Rectangle packing Shortest route. 8 queens Soduko Maximizing (minimizing) costs

Example problems. Combinatorial auction. Towers of Hanoi Rectangle packing Shortest route. 8 queens Soduko Maximizing (minimizing) costs FunLog Example problems Combinatorial auction sell all the items Towers of Hanoi Rectangle packing Shortest route. 8 queens Soduko Maximizing (minimizing) costs Finding a solution with given property The

More information

Integrating Mixed-Integer Optimisation & Satisfiability Modulo Theories

Integrating Mixed-Integer Optimisation & Satisfiability Modulo Theories Integrating Mixed-Integer Optimisation & Satisfiability Modulo Theories Application to Scheduling Miten Mistry and Ruth Misener Wednesday 11 th January, 2017 Mistry & Misener MIP & SMT Wednesday 11 th

More information

Modelling for Combinatorial Optimisation (1DL448) Uppsala University Autumn 2017 Report for Assignment n / the Project

Modelling for Combinatorial Optimisation (1DL448) Uppsala University Autumn 2017 Report for Assignment n / the Project Modelling for Combinatorial Optimisation (1DL448) Uppsala University Autumn 2017 Report for Assignment n / the Project Clara CLEVER Whiz KIDD 4th October 2017 This document shows the ingredients of a good

More information

VHDL Structural Modeling II

VHDL Structural Modeling II VHDL Structural Modeling II ECE-331, Digital Design Prof. Hintz Electrical and Computer Engineering 5/7/2001 331_13 1 Ports and Their Usage Port Modes in reads a signal out writes a signal inout reads

More information

Full file at

Full file at Java Programming: From Problem Analysis to Program Design, 3 rd Edition 2-1 Chapter 2 Basic Elements of Java At a Glance Instructor s Manual Table of Contents Overview Objectives s Quick Quizzes Class

More information

n n Try tutorial on front page to get started! n spring13/ n Stack Overflow!

n   n Try tutorial on front page to get started! n   spring13/ n Stack Overflow! Announcements n Rainbow grades: HW1-6, Quiz1-5, Exam1 n Still grading: HW7, Quiz6, Exam2 Intro to Haskell n HW8 due today n HW9, Haskell, out tonight, due Nov. 16 th n Individual assignment n Start early!

More information

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

A MiniZinc Tutorial. Kim Marriott and Peter J. Stuckey with contributions from Leslie De Koninck and Horst Samulowitz.

A MiniZinc Tutorial. Kim Marriott and Peter J. Stuckey with contributions from Leslie De Koninck and Horst Samulowitz. A MiniZinc Tutorial Kim Marriott and Peter J. Stuckey with contributions from Leslie De Koninck and Horst Samulowitz Contents 1 Introduction 4 2 Basic Modelling in MiniZinc 5 2.1 Our First Example......................................

More information

RSL Reference Manual

RSL Reference Manual RSL Reference Manual Part No.: Date: April 6, 1990 Original Authors: Klaus Havelund, Anne Haxthausen Copyright c 1990 Computer Resources International A/S This document is issued on a restricted basis

More information

LOGIC AND DISCRETE MATHEMATICS

LOGIC AND DISCRETE MATHEMATICS LOGIC AND DISCRETE MATHEMATICS A Computer Science Perspective WINFRIED KARL GRASSMANN Department of Computer Science University of Saskatchewan JEAN-PAUL TREMBLAY Department of Computer Science University

More information

K Reference Card. Complete example

K Reference Card. Complete example K Reference Card Complete example package examples.example1 annotation doc : String class Date class Person { name : String age : Int ssnr : Int @doc("employee inherits from Person") class Employee extends

More information

axiomatic semantics involving logical rules for deriving relations between preconditions and postconditions.

axiomatic semantics involving logical rules for deriving relations between preconditions and postconditions. CS 6110 S18 Lecture 18 Denotational Semantics 1 What is Denotational Semantics? So far we have looked at operational semantics involving rules for state transitions, definitional semantics involving translations

More information

9/21/17. Outline. Expression Evaluation and Control Flow. Arithmetic Expressions. Operators. Operators. Notation & Placement

9/21/17. Outline. Expression Evaluation and Control Flow. Arithmetic Expressions. Operators. Operators. Notation & Placement Outline Expression Evaluation and Control Flow In Text: Chapter 6 Notation Operator evaluation order Operand evaluation order Overloaded operators Type conversions Short-circuit evaluation of conditions

More information

Constraint Programming

Constraint Programming Constraint Programming - An overview Examples, Satisfaction vs. Optimization Different Domains Constraint Propagation» Kinds of Consistencies Global Constraints Heuristics Symmetries 7 November 0 Advanced

More information

Programming in C++ Prof. Partha Pratim Das Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

Programming in C++ Prof. Partha Pratim Das Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Programming in C++ Prof. Partha Pratim Das Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Lecture 04 Programs with IO and Loop We will now discuss the module 2,

More information

Reduction of nite linear CSPs to SAT using dierent encod

Reduction of nite linear CSPs to SAT using dierent encod Reduction of nite linear CSPs to SAT using dierent encodings Mirko Stojadinovi mirkos@matf.bg.ac.rs Department of Computer Science Faculty of Mathematics University of Belgrade Fifth Workshop on Formal

More information

Chapter 1 Summary. Chapter 2 Summary. end of a string, in which case the string can span multiple lines.

Chapter 1 Summary. Chapter 2 Summary. end of a string, in which case the string can span multiple lines. Chapter 1 Summary Comments are indicated by a hash sign # (also known as the pound or number sign). Text to the right of the hash sign is ignored. (But, hash loses its special meaning if it is part of

More information

CSCI.6962/4962 Software Verification Fundamental Proof Methods in Computer Science (Arkoudas and Musser) Chapter p. 1/27

CSCI.6962/4962 Software Verification Fundamental Proof Methods in Computer Science (Arkoudas and Musser) Chapter p. 1/27 CSCI.6962/4962 Software Verification Fundamental Proof Methods in Computer Science (Arkoudas and Musser) Chapter 2.1-2.7 p. 1/27 CSCI.6962/4962 Software Verification Fundamental Proof Methods in Computer

More information

Round 4: Constraint Satisfaction Problems (CSP)

Round 4: Constraint Satisfaction Problems (CSP) Round 4: Constraint Satisfaction Problems (CSP) Tommi Junttila Aalto University School of Science Department of Computer Science CS-E3220 Declarative Programming Spring 2018 Tommi Junttila (Aalto University)

More information

Decision Procedures. An Algorithmic Point of View. Bit-Vectors. D. Kroening O. Strichman. Version 1.0, ETH/Technion

Decision Procedures. An Algorithmic Point of View. Bit-Vectors. D. Kroening O. Strichman. Version 1.0, ETH/Technion Decision Procedures An Algorithmic Point of View Bit-Vectors D. Kroening O. Strichman ETH/Technion Version 1.0, 2007 Part VI Bit-Vectors Outline 1 Introduction to Bit-Vector Logic 2 Syntax 3 Semantics

More information

Department of Computer Science COMP The Programming Competency Test

Department of Computer Science COMP The Programming Competency Test The Australian National University Faculty of Engineering & Information Technology Department of Computer Science COMP1120-2003-01 The Programming Competency Test 1 Introduction The purpose of COMP1120

More information

Programming Language Concepts: Lecture 14

Programming Language Concepts: Lecture 14 Programming Language Concepts: Lecture 14 Madhavan Mukund Chennai Mathematical Institute madhavan@cmi.ac.in http://www.cmi.ac.in/~madhavan/courses/pl2009 PLC 2009, Lecture 14, 11 March 2009 Function programming

More information

Constraint solving on modular integers

Constraint solving on modular integers Constraint solving on modular integers Arnaud Gotlieb*, Michel Leconte**, Bruno Marre*** * INRIA Research center of Bretagne Rennes Atlantique ** ILOG Lab, IBM France *** CEA List ModRef 10 Workshop, 6/09/10

More information

In Our Last Exciting Episode

In Our Last Exciting Episode In Our Last Exciting Episode #1 Lessons From Model Checking To find bugs, we need specifications What are some good specifications? To convert a program into a model, we need predicates/invariants and

More information

Language Reference Manual simplicity

Language Reference Manual simplicity Language Reference Manual simplicity Course: COMS S4115 Professor: Dr. Stephen Edwards TA: Graham Gobieski Date: July 20, 2016 Group members Rui Gu rg2970 Adam Hadar anh2130 Zachary Moffitt znm2104 Suzanna

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

Typed Racket: Racket with Static Types

Typed Racket: Racket with Static Types Typed Racket: Racket with Static Types Version 5.0.2 Sam Tobin-Hochstadt November 6, 2010 Typed Racket is a family of languages, each of which enforce that programs written in the language obey a type

More information

Solving XCSP problems by using Gecode

Solving XCSP problems by using Gecode Solving XCSP problems by using Gecode Massimo Morara, Jacopo Mauro, and Maurizio Gabbrielli University of Bologna. morara jmauro gabbri@cs.unibo.it Abstract. Gecode is one of the most efficient libraries

More information

Haskell 98 in short! CPSC 449 Principles of Programming Languages

Haskell 98 in short! CPSC 449 Principles of Programming Languages Haskell 98 in short! n Syntax and type inferencing similar to ML! n Strongly typed! n Allows for pattern matching in definitions! n Uses lazy evaluation" F definition of infinite lists possible! n Has

More information

Unit-II Programming and Problem Solving (BE1/4 CSE-2)

Unit-II Programming and Problem Solving (BE1/4 CSE-2) Unit-II Programming and Problem Solving (BE1/4 CSE-2) Problem Solving: Algorithm: It is a part of the plan for the computer program. An algorithm is an effective procedure for solving a problem in a finite

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

Weiss Chapter 1 terminology (parenthesized numbers are page numbers)

Weiss Chapter 1 terminology (parenthesized numbers are page numbers) Weiss Chapter 1 terminology (parenthesized numbers are page numbers) assignment operators In Java, used to alter the value of a variable. These operators include =, +=, -=, *=, and /=. (9) autoincrement

More information

CS152: Programming Languages. Lecture 11 STLC Extensions and Related Topics. Dan Grossman Spring 2011

CS152: Programming Languages. Lecture 11 STLC Extensions and Related Topics. Dan Grossman Spring 2011 CS152: Programming Languages Lecture 11 STLC Extensions and Related Topics Dan Grossman Spring 2011 Review e ::= λx. e x e e c v ::= λx. e c τ ::= int τ τ Γ ::= Γ, x : τ (λx. e) v e[v/x] e 1 e 1 e 1 e

More information

Copyright 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley. Chapter 6 Outline. Unary Relational Operations: SELECT and

Copyright 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley. Chapter 6 Outline. Unary Relational Operations: SELECT and Chapter 6 The Relational Algebra and Relational Calculus Copyright 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 6 Outline Unary Relational Operations: SELECT and PROJECT Relational

More information

Absolute C++ Walter Savitch

Absolute C++ Walter Savitch Absolute C++ sixth edition Walter Savitch Global edition This page intentionally left blank Absolute C++, Global Edition Cover Title Page Copyright Page Preface Acknowledgments Brief Contents Contents

More information

DISCRETE MATHEMATICS

DISCRETE MATHEMATICS DISCRETE MATHEMATICS WITH APPLICATIONS THIRD EDITION SUSANNA S. EPP DePaul University THOIVISON * BROOKS/COLE Australia Canada Mexico Singapore Spain United Kingdom United States CONTENTS Chapter 1 The

More information

Object oriented programming. Instructor: Masoud Asghari Web page: Ch: 3

Object oriented programming. Instructor: Masoud Asghari Web page:   Ch: 3 Object oriented programming Instructor: Masoud Asghari Web page: http://www.masses.ir/lectures/oops2017sut Ch: 3 1 In this slide We follow: https://docs.oracle.com/javase/tutorial/index.html Trail: Learning

More information

LocalSolver 4.0: novelties and benchmarks

LocalSolver 4.0: novelties and benchmarks LocalSolver 4.0: novelties and benchmarks Thierry Benoist Julien Darlay Bertrand Estellon Frédéric Gardi Romain Megel www.localsolver.com 1/18 LocalSolver 3.1 Solver for combinatorial optimization Simple

More information

Lecture Notes on Real-world SMT

Lecture Notes on Real-world SMT 15-414: Bug Catching: Automated Program Verification Lecture Notes on Real-world SMT Matt Fredrikson Ruben Martins Carnegie Mellon University Lecture 15 1 Introduction In the previous lecture we studied

More information

System Description of a SAT-based CSP Solver Sugar

System Description of a SAT-based CSP Solver Sugar System Description of a SAT-based CSP Solver Sugar Naoyuki Tamura 1, Tomoya Tanjo 2, and Mutsunori Banbara 1 1 Information Science and Technology Center, Kobe University, JAPAN {tamura,banbara}@kobe-u.ac.jp

More information

Functional Logic Programming Language Curry

Functional Logic Programming Language Curry Functional Logic Programming Language Curry Xiang Yin Department of Computer Science McMaster University November 9, 2010 Outline Functional Logic Programming Language 1 Functional Logic Programming Language

More information

\n is used in a string to indicate the newline character. An expression produces data. The simplest expression

\n is used in a string to indicate the newline character. An expression produces data. The simplest expression Chapter 1 Summary Comments are indicated by a hash sign # (also known as the pound or number sign). Text to the right of the hash sign is ignored. (But, hash loses its special meaning if it is part of

More information

Satisfiability Modulo Theories. DPLL solves Satisfiability fine on some problems but not others

Satisfiability Modulo Theories. DPLL solves Satisfiability fine on some problems but not others DPLL solves Satisfiability fine on some problems but not others DPLL solves Satisfiability fine on some problems but not others Does not do well on proving multipliers correct pigeon hole formulas cardinality

More information

MATVEC: MATRIX-VECTOR COMPUTATION LANGUAGE REFERENCE MANUAL. John C. Murphy jcm2105 Programming Languages and Translators Professor Stephen Edwards

MATVEC: MATRIX-VECTOR COMPUTATION LANGUAGE REFERENCE MANUAL. John C. Murphy jcm2105 Programming Languages and Translators Professor Stephen Edwards MATVEC: MATRIX-VECTOR COMPUTATION LANGUAGE REFERENCE MANUAL John C. Murphy jcm2105 Programming Languages and Translators Professor Stephen Edwards Language Reference Manual Introduction The purpose of

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

The SMT-LIB Standard Version 2.0. Clark Barrett Aaron Stump Cesare Tinelli

The SMT-LIB Standard Version 2.0. Clark Barrett Aaron Stump Cesare Tinelli The SMT-LIB Standard Version 2.0 Clark Barrett Aaron Stump Cesare Tinelli Release: March 30, 2010 Copyright c 2010 Clark Barrett, Aaron Stump and Cesare Tinelli. Permission is granted to anyone to make

More information

Decaf Language Reference Manual

Decaf Language Reference Manual Decaf Language Reference Manual C. R. Ramakrishnan Department of Computer Science SUNY at Stony Brook Stony Brook, NY 11794-4400 cram@cs.stonybrook.edu February 12, 2012 Decaf is a small object oriented

More information

Contents. Figures. Tables. Examples. Foreword. Preface. 1 Basics of Java Programming 1. xix. xxi. xxiii. xxvii. xxix

Contents. Figures. Tables. Examples. Foreword. Preface. 1 Basics of Java Programming 1. xix. xxi. xxiii. xxvii. xxix PGJC4_JSE8_OCA.book Page ix Monday, June 20, 2016 2:31 PM Contents Figures Tables Examples Foreword Preface xix xxi xxiii xxvii xxix 1 Basics of Java Programming 1 1.1 Introduction 2 1.2 Classes 2 Declaring

More information

Functional Programming in Haskell Part I : Basics

Functional Programming in Haskell Part I : Basics Functional Programming in Haskell Part I : Basics Madhavan Mukund Chennai Mathematical Institute 92 G N Chetty Rd, Chennai 600 017, India madhavan@cmi.ac.in http://www.cmi.ac.in/ madhavan Madras Christian

More information

CS 1200 Discrete Math Math Preliminaries. A.R. Hurson 323 CS Building, Missouri S&T

CS 1200 Discrete Math Math Preliminaries. A.R. Hurson 323 CS Building, Missouri S&T CS 1200 Discrete Math A.R. Hurson 323 CS Building, Missouri S&T hurson@mst.edu 1 Course Objective: Mathematical way of thinking in order to solve problems 2 Variable: holder. A variable is simply a place

More information

UNIT- 3 Introduction to C++

UNIT- 3 Introduction to C++ UNIT- 3 Introduction to C++ C++ Character Sets: Letters A-Z, a-z Digits 0-9 Special Symbols Space + - * / ^ \ ( ) [ ] =!= . $, ; : %! &? _ # = @ White Spaces Blank spaces, horizontal tab, carriage

More information

ZIMPL User Guide. Konrad-Zuse-Zentrum für Informationstechnik Berlin THORSTEN KOCH. ZIB-Report (August 2001)

ZIMPL User Guide. Konrad-Zuse-Zentrum für Informationstechnik Berlin THORSTEN KOCH. ZIB-Report (August 2001) Konrad-Zuse-Zentrum für Informationstechnik Berlin Takustraße 7 D-14195 Berlin-Dahlem Germany THORSTEN KOCH ZIMPL User Guide ZIB-Report 01-20 (August 2001) (Zuse Institute Mathematical Programming Language)

More information

A Language for Specifying Type Contracts in Erlang and its Interaction with Success Typings

A Language for Specifying Type Contracts in Erlang and its Interaction with Success Typings A Language for Specifying Type Contracts in Erlang and its Interaction with Success Typings Miguel Jiménez 1, Tobias Lindahl 1,2, Konstantinos Sagonas 3,1 1 Department of Information Technology, Uppsala

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

A Short Summary of Javali

A Short Summary of Javali A Short Summary of Javali October 15, 2015 1 Introduction Javali is a simple language based on ideas found in languages like C++ or Java. Its purpose is to serve as the source language for a simple compiler

More information

Chapter 2 Working with Data Types and Operators

Chapter 2 Working with Data Types and Operators JavaScript, Fourth Edition 2-1 Chapter 2 Working with Data Types and Operators At a Glance Instructor s Manual Table of Contents Overview Objectives Teaching Tips Quick Quizzes Class Discussion Topics

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

Programming Languages Assignment #7

Programming Languages Assignment #7 Programming Languages Assignment #7 December 2, 2007 1 Introduction This assignment has 20 points total. In this assignment, you will write a type-checker for the PolyMinML language (a language that is

More information

CPS 506 Comparative Programming Languages. Programming Language Paradigm

CPS 506 Comparative Programming Languages. Programming Language Paradigm CPS 506 Comparative Programming Languages Functional Programming Language Paradigm Topics Introduction Mathematical Functions Fundamentals of Functional Programming Languages The First Functional Programming

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

Introduction to Computers and C++ Programming p. 1 Computer Systems p. 2 Hardware p. 2 Software p. 7 High-Level Languages p. 8 Compilers p.

Introduction to Computers and C++ Programming p. 1 Computer Systems p. 2 Hardware p. 2 Software p. 7 High-Level Languages p. 8 Compilers p. Introduction to Computers and C++ Programming p. 1 Computer Systems p. 2 Hardware p. 2 Software p. 7 High-Level Languages p. 8 Compilers p. 9 Self-Test Exercises p. 11 History Note p. 12 Programming and

More information

The SPL Programming Language Reference Manual

The SPL Programming Language Reference Manual The SPL Programming Language Reference Manual Leonidas Fegaras University of Texas at Arlington Arlington, TX 76019 fegaras@cse.uta.edu February 27, 2018 1 Introduction The SPL language is a Small Programming

More information

The PCAT Programming Language Reference Manual

The PCAT Programming Language Reference Manual The PCAT Programming Language Reference Manual Andrew Tolmach and Jingke Li Dept. of Computer Science Portland State University September 27, 1995 (revised October 15, 2002) 1 Introduction The PCAT language

More information

Binghamton University. CS-211 Fall Syntax. What the Compiler needs to understand your program

Binghamton University. CS-211 Fall Syntax. What the Compiler needs to understand your program Syntax What the Compiler needs to understand your program 1 Pre-Processing Any line that starts with # is a pre-processor directive Pre-processor consumes that entire line Possibly replacing it with other

More information

LECTURE 6 CONSTRAINT PROGRAMMING & GLOBAL CONSTRAINTS

LECTURE 6 CONSTRAINT PROGRAMMING & GLOBAL CONSTRAINTS LECURE 6 CONSRAIN PROGRAMMING & GLOBAL CONSRAINS AI (C.S.P.) AI languages (Alice, Constraints) Logic Programming Historical Account of Constraint Programming Constraint (Logic) Programming AI (CSP) Operations

More information

EE292: Fundamentals of ECE

EE292: Fundamentals of ECE EE292: Fundamentals of ECE Fall 2012 TTh 10:00-11:15 SEB 1242 Lecture 22 121115 http://www.ee.unlv.edu/~b1morris/ee292/ 2 Outline Review Binary Number Representation Binary Arithmetic Combinatorial Logic

More information

Bitwise Data Manipulation. Bitwise operations More on integers

Bitwise Data Manipulation. Bitwise operations More on integers Bitwise Data Manipulation Bitwise operations More on integers bitwise operators ex Bitwise operators on fixed-width bit vectors. AND & OR XOR ^ NOT ~ 01101001 & 01010101 01000001 01101001 01010101 01101001

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