Examples and Sets. Synthesize each of These choose((x,y) =>10 x + 14 y == a) choose((x,y) =>10 x + 14 y == a&& x < y) choose((x,y) =>10 x + 14 y == a.

Slides:



Advertisements
Similar presentations
Lesson 1.3 Unit 1, Lesson 3. Set:A collection of distinct objects Elements:All of the objects that make up a set.
Advertisements

4.5 Graphing Linear Equations
Systems of Linear Equations Vocabulary. This is a System of Linear Equations.
Warm - Up Graph the linear equation 2y + 4x = -2..
7.1 Graphing Linear Systems
Solving Systems of Equations: Elimination Method.
Math 71A 3.1 – Systems of Linear Equations in Two Variables 1.
Chapter 7.1 Notes: Solve Linear Systems by Graphing Goal: You will solve a system of linear equations graphically.
Table of Contents The goal in solving a linear system of equations is to find the values of the variables that satisfy all of the equations in the system.
IB Math Studies – Topic 2. IB Course Guide Description.
Advanced Algebra Notes
Elimination Day 2. When the two equations don’t have an opposite, what do you have to do? 1.
System of Linear Equations with One Solution Solve the given system of linear equations by graphing both equations on the same integer screen. 1. The point.
Synthesis using Variable Elimination Viktor Kuncak EPF Lausanne
Synthesis, Analysis, and Verification Lecture 01c Lectures: Viktor Kuncak Exercises and Labs: Eva Darulová Giuliano Losa About Synthesis General Background.
Systems of Equations Graphing Systems of Equations is used by people with careers in biological science, such as ecologists. An ecologist uses graphs of.
LINEAR SYSTEMS – Graphing Method In this module, we will be graphing two linear equations on one coordinate plane and seeing where they intersect. You.
Solving Compound Inequalities. Domain: A-REI Reasoning with Equations & Inequalities Cluster: 1. Understand solving equations as a process of reasoning.
Math /4.2/4.3 – Solving Systems of Linear Equations 1.
Linear Equations in Two Variables A Linear Equation in Two Variables is any equation that can be written in the form where A and B are not both zero.
Ruzica Piskac Max Planck Institute for Software Systems, Germany.
Integrating high-level constructs into programming languages Language extensions to make programming more productive Underspecified programs –give assertions,
Modular (Remainder) Arithmetic n = qk + r (for some k; r < k) eg 37 = (2)(17) + 3 Divisibility notation: 17 | n mod k = r 37 mod 17 = 3.
Elimination Method: Solve the linear system. -8x + 3y=12 8x - 9y=12.
Notation Intro. Number Theory Online Cryptography Course Dan Boneh
Systems of Equations Standards: MCC9-12.A.REI.5-12
Topic: U4L2 Solving Nonlinear Systems of Equations EQ: How can I solve a system of equations if one or more of the equations does not represent a line?
Differential Equations Linear Equations with Variable Coefficients.
Section 9.3 Systems of Linear Equations in Several Variables Objectives: Solving systems of linear equations using Gaussian elimination.
Section 7.1 Systems of Linear Equations in Two Variables.
3.1 Solving Systems By Graphing Or Substitution. * A system of equations is a collection of equations in the same variable. *A solution to a system is.
Using Systems of Equations to Solve Problems A Write and/or solve a system of linear equations (including problem situations) using graphing,
 How do I solve a system of Linear equations using the graphing method?
2( ) 8x + 14y = 4 -12x – 14y = x = x = 4 8x + 14y = 4 8(4) + 14y = y = y = -28 ___ ___ y = -2 The solution is (4, -2)
Lesson 9.6 Topic/ Objective: To solve non linear systems of equations. EQ: How do you find the point of intersection between two equations when one is.
3.5 Solving systems of equations in three variables Main Ideas Solve systems of linear equations in three variables. Solve real-world problems using systems.
Section 8.1 Systems of Linear Equations in Two Variables.
Lesson 4-1 Solving linear system of equations by graphing
Simultaneous Equations 1
Classifying Systems, Solving Systems by Graphing and Substitution
10.1 SYSTEMS OF LINEAR EQUATIONS: SUBTRACTION, ELIMINATION.
Chapter 6 Conic Sections
Aim #8.1:How do we solve systems of equations with two variables?
Systems of Nonlinear Equations
Synthesis using Variable Elimination
SYSTEMS OF LINEAR EQUATIONS
Systems of Nonlinear Equations
Solving Linear Systems Algebraically
Solve a system of linear equation in two variables
Section 5.1 Systems of Linear Equations in Two Variables
Solve Systems of Equations
The Extended Euclidean Algorithm (2/10)
Graphing systems of linear equations and inequalities
Solve Linear Equations by Elimination
9.6 Solving Systems of Equations by Graphing
SIMULTANEOUS EQUATIONS 1
Complete Program Synthesis for Linear Arithmetics
Objectives Identify solutions of linear equations in two variables.
Three Variables We extend the general form of a linear equation to make room for a third variable. Ax + By + Cz = D where A, B, C, D are some real numbers.
System of Linear Equations:
Systems of Equations Solve by Graphing.
Solve the linear system.
Chapter 8 Systems of Equations
Example 2B: Solving Linear Systems by Elimination
7.1 Solving Systems of Equations
5.1 -Systems of Linear Equations
Systems of Nonlinear Equations
Nonlinear Systems of Equations
Indicator 16 System of Equations.
Solving Linear Systems by Graphing
Presentation transcript:

Examples and Sets

Synthesize each of These choose((x,y) =>10 x + 14 y == a) choose((x,y) =>10 x + 14 y == a&& x < y) choose((x,y) =>10 x + 14 y == a && 0 < x && x < y)

Constructive (Extended) Euclid’s Algorithm: gcd(10,14) x + 14 y == 10 x + 14 y == a

Result of Synthesis for one Equation choose((x,y) =>10 x + 14 y == a) assert ( ) val x = val y = check the solution: Change in requirements! Customer also wants: x < y does our solution work for e.g. a=2

Idea: Eliminate Variables x = 3/2 a + c 1 z y = -a + c 2 z choose((x,y) =>10 x + 14 y == a&& x < y) Cannot easily eliminate one of the x,y. Eliminate both x,y, get one free - z Find general form, characterize all solutions, parametric solution c 1 = ? c 2 = ?

Idea: Eliminate Variables x = 3/2 a + c 1 z y = -a + c 2 z choose((x,y) =>10 x + 14 y == a&& x < y) c 1 = ? c 2 = ? 10 x y 0 + (10 c c 2 ) == a 10 c c 2 == 0

x = 3/2 a + 5 z y = -a - 7 z choose((x,y) =>10 x + 14 y == a&& x < y)

Synthesis for sets def splitBalanced[T](s: Set[T]) : (Set[T], Set[T]) = choose((a: Set[T], b: Set[T]) ⇒ ( a union b == s && a intersect b == empty && a.size – b.size ≤ 1 && b.size – a.size ≤ 1 )) def splitBalanced[T](s: Set[T]) : (Set[T], Set[T]) = val k = ((s.size + 1)/2).floor val t1 = k val t2 = s.size – k val s1 = take(t1, s) val s2 = take(t2, s minus s1) (s1, s2) a b s

From Data Structures to Numbers Observation: – Reasoning about collections reduces to reasoning about linear integer arithmetic! 9 a.size == b.size && a union b == bigSet && a intersect b == empty a b bigSet

From Data Structures to Numbers Observation: – Reasoning about collections reduces to reasoning about linear integer arithmetic! 10 a.size == b.size && a union b == bigSet && a intersect b == empty a b bigSet

From Data Structures to Numbers Observation: – Reasoning about collections reduces to reasoning about linear integer arithmetic! 11 a.size == b.size && a union b == bigSet && a intersect b == empty a b bigSet

From Data Structures to Numbers Observation: – Reasoning about collections reduces to reasoning about linear integer arithmetic! 12 a.size == b.size && a union b == bigSet && a intersect b == empty a b bigSet New specification: kA = kB New specification: kA = kB

From Data Structures to Numbers Observation: – Reasoning about collections reduces to reasoning about linear integer arithmetic! 13 a.size == b.size && a union b == bigSet && a intersect b == empty a b bigSet New specification: kA = kB && kA +kB = |bigSet| New specification: kA = kB && kA +kB = |bigSet|