1 / 20

Termination and Correctness Analysis of Cyclic Control

Siddharth Srivastava, Neil Immerman , Shlomo Zilberstein University of Massachusetts Amherst. Termination and Correctness Analysis of Cyclic Control. Cyclic Control Flow. Cyclic control is essential in algorithms Essential to many branches of AI for the same reasons

kirk
Download Presentation

Termination and Correctness Analysis of Cyclic Control

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. Siddharth Srivastava, Neil Immerman, ShlomoZilberstein University of Massachusetts Amherst Termination and Correctness Analysis of Cyclic Control

  2. Cyclic Control Flow • Cyclic control is essential in algorithms • Essential to many branches of AI for the same reasons • Makes control structures compact, more generally applicable • Examples: • Workflow mining • Programming by demonstration • Automated planning • Automated service composition • Synthesis of robot controllers

  3. Workflow Mining [Ekeret al. ‘09]

  4. Programming by Demonstration • Given: sequences of ops for reversing small linked lists • Generate: reverse algorithm for unbounded LL

  5. Automated Planning • Plans with loops: broad applicability [Winner et al. ’03, Bonet et al. ’09, Hu et al. ’10]

  6. Generalized Plans: A Unifying Framework [ICAPS GenPlan‘09, AIJ ‘11] Common Challenges • Applicability test • Cost of instantiation • Domain coverage • Quality of instantiation • Complexity of representation • Control knowledge + • A method for instantiation • Given a problem instance, will the execution of this GP solve it? i.e.: • Terminate? • Reach a goal state? • = Correctness

  7. Applicability Test Typical assumption: loop = non-nested iteration over collections • Fundamental Open Questions • Are there useful, more general classes where reasoning about loops is even computable? • How can we categorize such problem classes? • How can we determine if a cyclic control flow will terminate and achieve a desired result in these classes?

  8. A Fundamental Formulation [Abacus Programs]

  9. Abacus Programs • Finite sets of states & registers • Actions with unit increments/decrements • Decrement actions have two effects: • If R1=0, goto S3 • If R1>0: R1--; goto S2 Turing Machine-equivalent model of computation [Lambek, 61]

  10. Abacus Programs: Expressiveness • Abacus programs can express any control flow • The reachability problem: Can state Sibe reached in an execution? Addresses both termination and correctness

  11. Abacus Programs: Expressiveness • But reachability is equivalent to the halting problem for Turing machines in general… Undecidable! We identified useful cases where it can be solved

  12. Computing Preconditions: Idea • We build on this idea to develop methods for • Simple loops • Monotone simple loops with shortcuts

  13. Subclass: Simple Loops with Shortcuts Need to be monotone: Net change on a register (if any) in each simple loop must have the same sign

  14. Order Independence loop1 loop2 • Loop1: increases R1 by 3 • Loop2: decreases it by 2, then increases it by 5 • Precondition for 1 iteration is order dependent (maintain R1 ≥ 0): We compute conditions for an adversarial ordering Such conditions cannot even be expressed efficiently using linear constraints

  15. Reachability Results Theorem Given : abacus program, all SCCs: simple loops with monotone shortcuts S: node in F: vector of desired register values A disjunction of linear constraints on the initial register values gives sufficient conditions for reaching S with register values F. • Computed conditions are also necessary if: • every simple loop with shortcuts is order independent [Srivastava et al., ICAPS-10]

  16. Applications • These results allow us to: • Test correctness of a given generalized plan • Search for safe control structures

  17. Application in Automated Planning [Srivastava et al., AIJ-11] • Under some conditions, can ensure: • All branch effects categorized by “role”-counts • Role-counts undergo constant change due to actions

  18. Conclusions: Fundamental Results • Are there useful, more general classes where reasoning about loops is even computable? • Yes! • How can we categorize such problem classes? • Abacus programs; structural properties • In these classes, how can we determine if a cyclic control flow will terminate and achieve a desired result? • Translation to abacus programs • Reachability queries

  19. Reachability Results: Future Work • Removing monotonicity makes reachability undecidable • even for simple loops with shortcuts! • Future Work • Efficiently expressing order dependent preconditions • Identifying greater classes of abacus programs(?) where reachability is decidable to be continued…

  20. Questions?

More Related