1 / 16

Programming from Galois Connections

Anisa Allahdadi Thematic Seminar 21 June 2012. Programming from Galois Connections. Objectives. Problem Statements: one defining a broad class of solutions ( the easy part) requesting one particular optimal solution , ( the hard part )

Télécharger la présentation

Programming from Galois Connections

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. Anisa Allahdadi Thematic Seminar 21 June 2012 Programming from Galois Connections

  2. Objectives • Problem Statements: • one defining a broad class of solutions (the easy part) • requesting one particular optimal solution, (the hard part) • This article introduces a binary relational combinator which • mirrors this linguistics structure and • exploits its potential for calculating programs by optimization.

  3. Some skills of a good programmer • Abstraction • Abstract Modeling, in the early stages of thinking about a software problem • Induction • Solving a complex program by imagining some smaller parts already solved • Divide and conquer programming strategy

  4. The “Best” Solution • Whole number division: x ÷ y is the largest natural number when multiplied by y, is at most x • takeWhile p: longest prefix of the input list such that all elements satisfy predicate p • Scheduling: The best schedule for a collection of tasks, given their time spans and an acyclic graph

  5. Easy / Hard • E: the collection of solution candidates • H: criteria under which a best solution is chosen

  6. Example #1 • x ÷ y is the largest natural number that, when multiplied by y, is at most x.

  7. Galois Connection • A Galois connection is a pair of functions f and g satisfying: • f and g are adjoints of each other (f is the lower adjoint and g is the upper adjoint)

  8. Example #2 • Indirect Equality • Galois connection blending with indirect equality

  9. Cont.

  10. Example #3 • Take (n, x): yields the longest prefix of its input sequence up to some given length n.

  11. Cont.

  12. Shrink Operator • Galois adjoints • By the easy part E is “shrunk” by the requirements of the hard part H

  13. Cont. • Factoring Galois connection into two parts

  14. Cont. • Abbreviate to : • the left hand operator: • the right hand operand: • Given two relations of and , • “Shrunk by R”:

  15. Conclusion • Galois connection as a well-known mathematical device capable of scaling up • “programming from Galois connections” is proposed as a way of calculating programs from specifications in form of Galois connections • The main contribution of this work: using the algebra of programming expressed in closed formula which records what is “easy” and “hard” to implement • A new relational combinator (shrinking) expressing such formula at pointfree level • Cons: not every problem casts into a Galois connection

  16. Questions? • Thanks for your time!

More Related