1 / 36

Logique approchée

Logique approchée. VERA: http://www.lri.fr/~mdr/vera.htm CORRECT: http://www.lri.fr/~mdr/xml/. Michel de Rougemont Université Paris II. Complexity and Approximation. Classical approximation for a function f: Knapsack Maxcut 2. Decision problem (boolean function).

salali
Télécharger la présentation

Logique approchée

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Logique approchée VERA: http://www.lri.fr/~mdr/vera.htm CORRECT: http://www.lri.fr/~mdr/xml/ Michel de Rougemont Université Paris II

  2. Complexity and Approximation • Classical approximation for a function f: • Knapsack • Maxcut 2. Decision problem (boolean function)

  3. Approximate satisfiability • Satisfiability : Tree |= F • Approximate satisfiability Tree |= F Image on a class K of trees

  4. Approximate verification • Kripke structure, Execution Tree, Specification F Tree |= F 2. Approximate verification (LICS 2002) Tree |= F is much easier than Tree |= F • XML data: (ICALP 2004) • Verify that a large XML file is valid. (Satisfies a DTD). • Estimate distance from a file to a DTD • Rank documents on the Web

  5. VERA: Vérification approchée • Logique, Testeurs et Correcteurs • Testeurs et Correcteurs • Arbres réguliers • Abstraction probabiliste de programmes • Bornes inférieures sur OBDDs et automates • Abstraction en Model Checking • Mécanismes et Jeux • Calcul d’équilibre

  6. Logique, testeurs, correcteurs Un Testeur decide |= pour une formule F. Un Correcteur prend une structure U proche de K en entrée et calcule U’ dans K, proche de U. Problème: Une classe K définissable dans une logique L admet-elle un testeur et un correcteur? Théorème. (Alon and al. FOCS2000) Les mots reguliers sont testables pour la distance d’Edition. Généralisation aux arbres réguliers. Application au test de fichiers XML et à la correction XML.

  7. Vérification par Modèle • Programme P • Spécification F (X,Y) • Structure de donnée OBDD O = O • Problème : taille des structures explose • Complexité en Communication montre des bornes inférieures exponentielles. P F

  8. Testeurs et Vérification • La spécification admet un testeur P (A) =1 ssi A est 3 coloriable • Problème : comment appliquer le test à un programme? Â est 3-coloriable A est 3-coloriable

  9. Abstraction probabiliste P(A). Enumerate C: While (x <= n){ While (y <= n){ If A(x,y) check C(x)=C(y)}} • Define an abstraction • P(A). Enumerate C: • While (x <= m){ • While (y <= m){ • If A(x,y) check C(x)=C(y)}}

  10. Peut-on trouver une abstraction? • Toute propriété • Admet un testeur. • Comment trouver une abstraction à partir d’un programme P? • Difficulté algorithmique.

  11. Programmes probabilistes 1 (0.6) b 1 (0.4) d a 0 c a p p p p q Random sampling may approximate this probability. (Peyronnet’s thesis)

  12. Protocoles et jeux Mécanismes et Jeux • Calcul d’équilibre • Comment vérifier qu’un programme distribué atteindra un équilibre satisfaisant une propriété P? • Agents interagissent selon un modèle économique. • Véracité du protocole (Truthfulness) • Nash est approximable (Lipton 2003) • Mécanismes de sécurité et de régulation

  13. Distances on structures Let K be a class of finite structures and Examples: • Words • Edit distance • Edit distance with moves • Edit distance with moves, Cut, Paste • Trees • Graphs

  14. Edit distance on Words • Classical Edit Distance: Insertions, Deletions, Modifications • Edit Distance with moves 0111000011110011001 0111011110000011001

  15. Tree-Edit-Distance a b Deletion Edge a e c b a b e c d Insertion Node and Label f e e d c Tree Edit distance with moves: a a b b e e c d c d 1 move

  16. Tree-Edit-Distance on binary trees Binary trees : Distance with moves allows permutations Distance(T1,T2) =4 p-Distance (T1,T2) =2

  17. Estimating distances • Words • P algorithm • for small distances • Efficent algorithms for Edit Distance with moves • Trees • P algorithm • NP complete, non-approximable for Edit Distance with moves. • Efficient solution for small distances

  18. CORRECT: XML files XML file= Tree automaton (DTD) + Colored Tree • Test if a large file is « valid ». Solution: O(1) !! 2. If the distance to a DTD is small, correct the file. Solution O(n). 3. Rank the Web: For DTDs find the distances. Solution: less than O(n)!!!

  19. XML <?xml version="1.0"?> <!DOCTYPE a [ <!ELEMENT a (l,r)> <!ELEMENT r ((l,r)|q ) > <!ELEMENT l (#PCDATA) > <!ELEMENT q (#PCDATA) > ]> <a> <l></l> <r><l></l><r><l></l> <r>><l></l> <r>….. <l></l> <r> <q></q> </r> </r> </r>….. </r> </a> XML corrector : http://www.lri.fr/~mdr/xml/

  20. Tree automata (q1,q1)q2 (q1,q0)q2 (q2,-) q2 (-,q2) q2 • (q0, q0)  q1 • (q0,q1)  q1 q1 q1 q0 q1 q0 q2 q1 q0 q1 q1 q0 q0 q0 q0 q0 q0

  21. Feasible and infeasible subtrees Definition : a subtree t is feasible for L if there are subtrees (for its leaves) which reach states (q1...ql) such that the state of the root q=t(q1...ql) can reach an accepting state (in the automaton for L). A subtree is infeasible if it is not feasible feasible infeasible

  22. Infeasible subtrees Fact . If then the number of unfeasible subtrees of length a is O(n). Fact. If the distance is small, there are few infeasibles trees. Intuition : make local corrections at the root of the infeasible trees

  23. Structure of the correctorTree-Edit Distance Phase 1 : (Bottom-up) Marking of * nodes, roots of infeasible subtrees. Phase 2 : (Top-down) Recursive analysis of the * subtrees to make root accept. Phase 3 : (Bottom –up) Local corrections q0 q1

  24. Structure of the correctorTree-Edit Distance with moves q0 q1 1 move

  25. Phase 1 : bottom-up marking • Definitions: • A terminal *-node is the first sink node of a run • A * subtree of a node v is the subtree whose root • is v reaching leaves or *-node • A node v is a *-node if its state is a sink node • when all possible reachable states replace the • *-nodes of its *-subtree. • 4. Compute the size of the subtrees * Runs with all possible reachable states (q,q’) reach a sink. * * O(n) procedure.

  26. Phase 2 : top-down possible states Let (q,q’) a possible choice at the top *-subtree. Let q’’ a possible state for the *-node of the left *-subtree * * * q’’ instead of * q2 q1 Lemma 1: If Dist(T,L)<k, there are at most k *-nodes.

  27. General Correction Hypothesis : q1 in Ci q2 in Cj q’’ in Ck Case a: P such that Ci < Ck and Cj < Ck Find t1 and t2 as in case 1.a q’’ q’’ q2 q q1 q’ t1 t2 q1 q2

  28. Case 2: b and c Case b,c : P such that Ci >Ck and Cj < Ck Find t2 and let Cp=inf(Ci,Ck). Cut the left branch until Cp. Case d: P such that Ci >Ck and Cj > Ck Let Cp=inf(Ci,Ck). Cut the left branch until Cp. Let Cq=inf(Cj,Ck). Cut the right branch until Cq. q’’ q’’ q’ q2 q1 t2 q2 q’’ q’’ q2 q1

  29. Analysis of the corrector • Tree-Edit Distance Fact 1: finitely many insertions Fact 2: deletions unpredictable Consequences:no easy bound on the distance between T and T’. Correction up to a constant distance. 2. Tree-Edit Distance with moves. Correction up to . Estimate the distance, although the problem is NP-hard, non-approximable.

  30. General result Theorem: If Dist(T,L) <k, the general corrector finds T’ such that Dist(T,T’) <c.k. Proof : # *-nodes < k Case 1: 0 *-node: easy correction Case 2: at least 1 *-node. Looking at all possible k-variations will correct the errors in the *-subtree and diminish the *-nodes.

  31. Approximate structures Recall: Which games characterize ? Game 1: two players I and II. Game 2: one player II against “nature” (player I)

  32. Game 1 Two players I and II on U, V Phase 1: II choose U’, V’ at distance ε Phase 2 : I and II play EF of order k on U’,V’ II wins if V U U’ V’

  33. Game 2 (p,q) Two players and nature on U, V Phase 1: nature plays p points in Uor V Phase 2 : II answers with p points in V Phase 3 : I and II play EF(q) II wins if V U

  34. Comparisons of Games 1 and 2 Game 1  Game 2 for p(k, ε), q(k, ε) If there is a FO (k) formula which distinguishes U and V, there is an automaton A which distinguishes U and V. A tester for A would distinguish U and V with high probability.

  35. Comparisons of Games 1 and 2 Let A an automaton which distinguishes U and V. The tester accepts U and rejects V with high probability. There is an admissible path Z for which some sample of length at most q is feasible for U and infeasible for V In a game of order q, I would win with high probability.

  36. Conclusion • Vérifier exactement peut être trop difficile. • Vérifier approximativement peut être réalisable. • Testeurs et Correcteurs • Vérification probabiliste de programmes. • Abstraction probabiliste • Vérification de programmes probabilistes • Validité de fichiers XML • Vérification approchée d’équilibres de protocole.

More Related