Synthesizing Geometry Constructions Sumit Gulwani MSR, Redmond Vijay Korthikanti UIUC Ashish Tiwari SRI.

Slides:



Advertisements
Similar presentations
Assertion Checking over Combined Abstraction of Linear Arithmetic and Uninterpreted Functions Sumit Gulwani Microsoft Research, Redmond Ashish Tiwari SRI.
Advertisements

Automated Theorem Proving Lecture 1. Program verification is undecidable! Given program P and specification S, does P satisfy S?
Constructions Involving Circles
Semantics Static semantics Dynamic semantics attribute grammars
Programming with Constraint Solvers CS294: Program Synthesis for Everyone Ras Bodik Emina Torlak Division of Computer Science University of California,
Sumit Gulwani Microsoft Research, Redmond Dimensions in Program Synthesis ACM Symposium on Principles and Practice of Declarative.
Geometric Construction Notes 2
Salman Cheema 1, Sumit Gulwani 2, Joseph J. LaViola Jr 1 1: University of Central Florida 2: Microsoft Research.
1 Greedy Forwarding in Dynamic Scale-Free Networks Embedded in Hyperbolic Metric Spaces Dmitri Krioukov CAIDA/UCSD Joint work with F. Papadopoulos, M.
Chapter 1 Using Geogebra Exploration and Conjecture.
Program Analysis as Constraint Solving Sumit Gulwani (MSR Redmond) Ramarathnam Venkatesan (MSR Redmond) Saurabh Srivastava (Univ. of Maryland) TexPoint.
Outline Perpendicular bisector , circumcentre and orthocenter
Program Verification as Probabilistic Inference Sumit Gulwani Nebojsa Jojic Microsoft Research, Redmond.
Usable Synthesis Sumit Gulwani Microsoft Research, Redmond Usable Verification Workshop November 2010 MSR Redmond.
Program Synthesis for Automating Education Sumit Gulwani Microsoft Research, Redmond.
Synthesis of Loop-free Programs Sumit Gulwani (MSR), Susmit Jha (UC Berkeley), Ashish Tiwari (SRI) and Ramarathnam Venkatesan(MSR) Susmit Jha 1.
Michael Reyes MTED 301 Section 1-2. Subject: Geometry Grade Level:9-10 Lesson: The Distance Formula Objective: California Mathematics Content Standard.
MCA –Software Engineering Kantipur City College. Topics include  Formal Methods Concept  Formal Specification Language Test plan creation Test-case.
GEOMETRY
Facilitator: David Brown
Bellringer Your mission: Construct a perfect square using the construction techniques you have learned from Unit 1. You may NOT measure any lengths with.
Constructible Lengths And Irrational Numbers
Dimensions in Synthesis Sumit Gulwani Microsoft Research, Redmond May 2012.
Section 2.1 Perpendicularity
© 2010 Pearson Education, Inc. All rights reserved Constructions, Congruence, and Similarity Chapter 12.
Geometer’s Sketchpad and the New Geometry Strands By: David M. Usinski
James Matte Nicole Calbi SUNY Fredonia AMTNYS October 28 th, 2011.
Geometric Structure G.1Adevelop and awareness of the structure of a mathematical system, connecting definitions, postulates, logical reasoning and theorems.
Section 8.3 Connections Between Algebra & Geometry
3-dimensional shape cross section. 3-dimensional space.
Essential Question: How do I construct inscribed circles, circumscribed circles Standard: MCC9-12.G.C.3 & 4.
Geometry - Conic Section Unit 4. Purpose Standards Learning Progression Lesson Agenda Getting Ready for the Lesson (Resources and Tips) Vocabulary Activities.
1 Preliminaries Precalculus Review I Precalculus Review II
CALIFORNIA MATHEMATICS STANDARDS ALGEBRA Students identify and use the arithmetic properties of subsets of integers, rational, irrational, and real.
coordinates, lines and increment
Ruler &Compass Constructions
Geometer Sketch Pad Assignment Mark Breakdown. Exercise #1 – Question #1 Medians 4 All three meet at one point 4 Circle with a center at the centroid.
8 th Grade Math Common Core Standards. The Number System 8.NS Know that there are numbers that are not rational, and approximate them by rational numbers.
Dimensions in Synthesis Part 3: Ambiguity (Synthesis from Examples & Keywords) Sumit Gulwani Microsoft Research, Redmond May 2012.
SOFTWARE DESIGN.
5.2 Bisectors of a Triangle Geometry Ms. Reser. Objectives Use properties of perpendicular bisectors of a triangle as applied in Example 1. Use properties.
INTRODUCTION TO Euclid’s geometry The origins of geometry.
Making Math Easier for Kids By Besnik Keja Click on ABC for my research paper Click on my picture for video introduction.
The tension between parametric registers and explicit patterns Nurit Zehavi and Giora Mann.
Scientific Debugging. Errors in Software Errors are unexpected behaviors or outputs in programs As long as software is developed by humans, it will contain.
Triangle Centers - Overview Thousands of years ago, when the Greek philosophers were laying the first foundations of geometry, someone was experimenting.
5.2 Bisectors of a Triangle Geometry Mr. Davenport Fall 2009.
Static Techniques for V&V. Hierarchy of V&V techniques Static Analysis V&V Dynamic Techniques Model Checking Simulation Symbolic Execution Testing Informal.
PREDICATES AND QUANTIFIERS COSC-1321 Discrete Structures 1.
Introduction The owners of a radio station want to build a new broadcasting building located within the triangle formed by the cities of Atlanta, Columbus,
Bisectors of a Triangle Geometry. Objectives Use properties of perpendicular bisectors of a triangle. Use properties of angle bisectors of a triangle.
NY State Learning Standard 3- Mathematics at the Commencement Level By Andrew M. Corbett NY State HS Math Teacher Click to continue >>>
Progression in KS3/4 Algorithms MONDAY 30 TH NOVEMBER SUE SENTANCE.
Bisectors of a Triangle Geometry Objectives Use properties of angle bisectors of a triangle. Use properties of perpendicular bisectors of a triangle.
1 Representing and Reasoning on XML Documents: A Description Logic Approach D. Calvanese, G. D. Giacomo, M. Lenzerini Presented by Daisy Yutao Guo University.
Bisectors of Triangles
A Brief Look into Geometric Constructions Focusing on Basic Constructions and the Impossible Constructions Bethany Das, Emily Simenc, and Zach Tocchi .
Teaching with Instructional Software
Ruler &Compass Constructions
Learning Targets I will be able to: Prove and apply properties of perpendicular bisectors of a triangle. and prove and apply properties of angle bisectors.
Programming Languages 2nd edition Tucker and Noonan
Vocabulary concurrent point of concurrency circumcenter of a triangle
Chapter 2- Visual Basic Schneider
Geometry Equations of Circles.
Bisectors of a Triangle
Objectives and Student Expectations
Properties of Triangles
Day 42 – Square inscribed in a circle
Bisectors of a Triangle
Programming Languages 2nd edition Tucker and Noonan
Presentation transcript:

Synthesizing Geometry Constructions Sumit Gulwani MSR, Redmond Vijay Korthikanti UIUC Ashish Tiwari SRI

Given a triangle XYZ, construct circle C such that C passes through X, Y, and Z. 1 Ruler/Compass based Geometry Constructions X Z Y L1 L2 N C

Good platform for teaching logical reasoning. –Visual Nature: Makes it more accessible. Exercises both logical/visual abilities of left/right brain. –Fun Aspect: Ruler/compass restrictions make it fun, as in sports. Application in dynamic geometry or animations. –“Constructive” geometry macros (unlike numerical methods) enable fast re-computation of derived objects from free (moving) objects. 2 Why Geometry Constructions?

 Problem Formulation (as Program Synthesis) Synthesis Algorithm (based on inter-disciplinary ideas) –Idea 1: from Theory –Idea 2: from PL –Idea 3: from AI Experiments Future Vision 3 Outline

Types: Point, Line, Circle Methods: Ruler(Point, Point) -> Line Compass(Point, Point) -> Circle Intersect(Circle, Circle) -> Pair of Points Intersect(Line, Circle) -> Pair of Points Intersect(Line, Line) -> Point Geometry Program: A straight-line composition of the above methods. 4 Programming Language for Geometry Constructions

Given a triangle XYZ, construct circle C such that C passes through X, Y, and Z. 5 Example Problem: Program 1.C1 = Compass(X,Y); 2.C2 = Compass(Y,X); 3. = Intersect(C1,C2); 4.L1 = Ruler(P1,P2); 5.D1 = Compass(Z,X); 6.D2 = Compass(X,Z); 7. = Intersect(D1,D2); 8.L2 = Ruler(R1,R2); 9.N = Intersect(L1,L2); 10.C = Compass(N,X); X Z Y C1 C2 P1 P2 L1 D2 D1 R1 R2 L2 N C

Conjunction of predicates over arithmetic expressions Predicates p := e 1 = e 2 | e 1  e 2 | e 1 · e 2 Arithmetic Expressions e := Distance(Point, Point) | Slope(Point, Point) | e 1 § e 2 | c 6 Specification Language for Geometry Programs

Given a triangle XYZ, construct circle C such that C passes through X, Y, and Z. Precondition: Slope(X,Y)  Slope(X,Z) Æ Slope(X,Y)  Slope(Z,X) Postcondition: LiesOn(X,C) Æ LiesOn(Y,C) Æ LiesOn(Z,C) Where LiesOn(X,C) ´ Distance(X,Center(C)) = Radius(C) Example Problem: Precondition/Postcondition 7

Let P be a geometry program that computes outputs O from inputs I. Verification Problem: Check the validity of the following Hoare triple. Assume Pre(I); P Assert Post(I,O); Synthesis Problem: Given Pre(I), Post(I,O), find P such that the above Hoare triple is valid. 8 Verification/Synthesis Problem for Geometry Programs

Problem Formulation (as Program Synthesis)  Synthesis Algorithm (based on inter-disciplinary ideas) –Idea 1: from Theory –Idea 2: from PL –Idea 3: from AI Experiments Future Vision 9 Outline

Pre(I), P, Post(I,O) a)Existing decision procedures are complex. b)New efficient approach: Random Testing! 1.Choose I’ randomly from the set { I | Pre(I) }. 2.Compute O’ := P(I’). 3.If O’ satisfies Post(I’,O’) output “Verified”. Correctness Proof of (b): Objects constructed by P can be described using polynomial ops (+,-,*), square-root & division operator. The randomized polynomial identity testing algorithm lifts to square-root and division operators as well ! 10 Approaches to Verification Problem

Synthesis Algorithm: // First obtain a random input-output example. 1.Choose I’ randomly from the set { I | Pre(I) }. 2.Compute O’ s.t. Post(I’,O’) using numerical methods. // Now obtain a construction that can generate O’ from I’ (using exhaustive search). 3.S := I’; 4.While (S does not contain O’) 5. S := S [ { M(O 1,O 2 ) | O i 2 S, M 2 Methods } 6.Output construction steps for O’. 11 Idea 1 (from Theory): Symbolic Reasoning -> Concrete

Given a triangle XYZ, construct circle C such that C passes through X, Y, and Z. 12 Error Probability of the algorithm is extremely low. … L1 = Ruler(P1,P2); … L2 = Ruler(R1,R2); N = Intersect(L1,L2); C = Compass(N,X); 12 For an equilateral 4 XYZ, incenter coincides with circumcenter N. But what are the chances of choosing a random 4 XYZ to be an equilateral one? X Z Y L1 L2 N C

Synthesis algorithm times out because programs are large. Identify a library of commonly used patterns (pattern = “sequence of geometry methods”) –E.g., perpendicular/angular bisector, midpoint, tangent, etc. S := S [ { M(O 1,O 2 ) | O i 2 S, M 2 Methods } S := S [ { M(O 1,O 2 ) | O i 2 S, M 2 LibMethods } Two key advantages: –Search space: large depth -> small depth –Easier to explain solutions to students. 13 Idea 2 (from PL): High-level Abstractions

Given a triangle XYZ, construct circle C such that C passes through X, Y, and Z. 14 Use of high-level abstractions reduces program size 1.C1 = Compass(X,Y); 2.C2 = Compass(Y,X); 3. = Intersect(C1,C2); 4.L1 = Ruler(P1,P2); 5.D1 = Compass(Z,X); 6.D2 = Compass(X,Z); 7. = Intersect(D1,D2); 8.L2 = Ruler(R1,R2); 9.N = Intersect(L1,L2); 10.C = Compass(N,X); 1.L1 = PBisector(X,Y); 2.L2 = PBisector(X,Z); 3.N = Intersect(L1,L2); 4.C = Compass(N,X);

Synthesis algorithm is inefficient because the search space is too wide and hence still huge. Prune forward search by using A* style heuristics. S := S [ { M(O 1,O 2 ) | O i 2 S, M 2 LibMethods } S := S [ {M(O 1,O 2 ) | O i 2 S, M 2 LibMethods, IsGood(M(O 1,O 2 )) } Example: If a method constructs a line L that passes through a desired output point, then L is “good” (i.e., worth constructing). 15 Idea 3 (from AI): Goal Directed Search

Given a triangle XYZ, construct circle C such that C passes through X, Y, and Z. 16 Effectiveness of Goal-directed search 16 L1 and L2 are immediately constructed since they pass through output point N. On the other hand, other lines like angular bisectors are not eagerly constructed. X Z Y L1 L2 N C

Problem Formulation (as Program Synthesis) Synthesis Algorithm (based on inter-disciplinary ideas) –Idea 1: from Theory –Idea 2: from PL –Idea 3: from AI  Experiments Future Vision 17 Outline

25 benchmark problems. such as: Construct a square whose extended sides pass through 4 given points. 18 problems less than 1 second. 4 problems between 1-3 seconds. 3 problems seconds. Idea 2 (high-level abstractions) reduces programs of size 3-45 to Idea 3 (goal-directedness) improves performance by factor of times on most problems. 18 Experimental Results

19 Search space Exploration: With/without goal-directness

Problem Formulation (as Program Synthesis) Synthesis Algorithm (based on inter-disciplinary ideas) –Idea 1: from Theory –Idea 2: from PL –Idea 3: from AI Experiments  Future Vision 20 Outline

21 Problem Solving Engine with Natural Interfaces Natural Language Processing/ Sketch Recognition Paraphrasing Program Synthesis Engine Problem Description in English/Ink Problem Description as Logical Relation Solution as Straight-line Program Solution in English Joint work: Umair Ahmed, Kalika Bali, Monojit Chaudhuri (MSR India) Salman Cheema, Joseph LaViola (Univ of Central Florida)

Construct a triangle ABC with AB = 7 cm, angle B = 60 degree and BC + CA = 10 cm. 22 GeoSynth Demo

Education StudioPL Connection Automated SolvingProgram Synthesis Education StudioPL Connection Automated Solving Hint Generation Program Synthesis Interpolants 23 Various Aspects of an Intelligent Tutoring System Automated Grading Pointing Mistakes Suggesting Fixes Program Verification Bug Isolation Program Repair Problem GenerationTest Input Generation Content CreationVisual Studio Intellisense Goal: Make Education Interactive and Fun.

Dimensions in Program Synthesis (PPDP 2010) –Intent: Logic or Natural language/Ink –Language: Geometry programs –Search: Exhaustive search made efficient by property testing, high-level abstractions, goal-directedness. –Who benefits? Students/Teachers –What is the value addition? Towards making education interactive, fun, and accessible anytime/anywhere. Education is a new important application area for PL. –Motivation: Classroom size and costs rising, repetitive tasks. –Technology Trends: new devices, social networking. –PL has central role: 100 researchers may be busy for 20 years. –If you share this vision too, please get in touch! 24 Conclusion