Formal Verification of a Geometry Algorithm
Yves Bertot October 2018
1 / 38
Formal Verification of a Geometry Algorithm Yves Bertot October - - PowerPoint PPT Presentation
Formal Verification of a Geometry Algorithm Yves Bertot October 2018 1 / 38 Outline Triangulation algorithm Abstract presentation and successive refinements Symmetries of the triangle and the convex hull 2 / 38 Triangulations and
1 / 38
2 / 38
◮ Vorono¨
◮ darts: edge extremities ◮ two darts to make an edge, α0 ◮ darts around a point are connected, α1 ◮ A third permutation (α0 ◦ α1)−1 enumerates facets
◮ α0 and α1 are just pointers 3 / 38
4 / 38
◮ all operations on coordinates are deemed exact ◮ Only ring operations are necessary
◮ set difference, singletons, cardinal, union, intersection ◮ all sets are naturally finite and all operations are decidable 5 / 38
6 / 38
7 / 38
8 / 38
9 / 38
◮ Operations for computing the counter-clockwise operation rely
◮ Limiting the precision for the inputs and using double precision
◮ alternatively using 32-bit integers for inputs and 64 bit integers
◮ In Coq itself, all computations are exact by default ◮ We have to use a discrete number ring to be algorithmically
10 / 38
◮ a sequence s0, . . . , sn such that, for every i and x different
◮ it can also be described by giving s0 and the function f that
11 / 38
12 / 38
◮ remove that one ◮ add 3 new triangles made with the edges of the old triangle
◮ For each such separating boundary edge, make a new triangle
13 / 38
14 / 38
15 / 38
16 / 38
17 / 38
18 / 38
◮ All elements of the triangulation have 3 points ◮ The union of all triangles is the input set ◮ The whole convex hull is covered by triangles
19 / 38
20 / 38
21 / 38
22 / 38
23 / 38
24 / 38
◮ Caching data ◮ Sparse representation for sets 25 / 38
26 / 38
◮ The first component is the same as for the previous algorithm ◮ The second component is a function circulating the convex hull ◮ The third component is a point on the convex hull
◮ Detect and suppress red edges, keep blue edges ◮ Add two new edges from and two purple points 27 / 38
28 / 38
◮ values for all blue points are the same as the old path function ◮ Also true for the last purple point ◮ The new path constitutes the new convex hull
29 / 38
◮ 400 lines of proof
◮ 120 lines of proof 30 / 38
31 / 38
◮ Lists that are equal up to permutation may lead to different
◮ Introduce a function pick seq set that chooses elements in a
32 / 38
33 / 38
34 / 38
◮ Each list representing a triangle has cardinal 3 ◮ The list of triangles has no duplicates as sets
◮ For a point inside the convex hull, there is exactly one triangle
35 / 38
36 / 38
◮ into a cycle of pointers in C-like implementations ◮ into a list for a function implentation (run inside Coq)
◮ lazy verification of the constraints 37 / 38
38 / 38