SPA Conference session: Say what you want not how you want it done - logic programming with answer sets

One-line description: An introduction to declarative/logic programming with answer set programming
 
Session format: tutorial, 150 mins [read about the different session types]
 
Abstract:If you’ve ever struggled with programming a solution for a problem that had easy to describe constraints, but a difficult implementation, this session may be for you. Good programmers are lazy - so why waste your time implementing a solution when the computer can do it for you?

You will experience how easy it is to express and solve puzzles like sudoku in a declarative formalism. We will also lay the foundations for an automated music composition system

We will do this with declarative programming. It is a programming paradigm that allows the programmer to describe a problem and the requirements on the solutions in an intuitive way, rather than describing the algorithm to find the solutions to the problem. ASP (Answer Set Programming) is a declarative programming paradigm with its roots of in knowledge representation and reasoning, a subset of artificial intelligence.
In this session we’ll introduce you to basic principles of this programming paradigm by means of guided exercises. You will get acquainted with concepts like negation as failure, closed world assumption, inertia, and model generation.

Join us for some fun - let the computer solve your puzzles and generate music for you. Learn how describing your problems is sometimes enough to get them solved.
 
Audience background:Some experience in programming (does not have to be full time, dabblers & hackers welcome).
 
Benefits of participating:Learn a new programming paradigm. If you know prolog, this session covers what came after it. If you don’t: “and now for something completely different....”.
Thinking declaratively can also help you write better OO or functional programs (for instance when writing QuickCheck properties), it can give you inspiration for a different kind of solutions.
 
Materials provided:Handouts with a language cheat sheet and instructions on the exercises. (first exercises ‘painting by numbers’, gradually building up in difficulty).
Build server to generate .wav files and .mp3 for the automated music composition system (requires csound otherwise).
USB sticks with CLINGO (http://potassco.sourceforge.net/) ASP solverd, SEALION (http://www.sealion.at/) eclipse plugin or a complete eclipse for ASP.
USB sticks also contain a bootable Linux environment with clingo, eclipse with sealion and command line environment.
Participants can also use their favorite text editor together with clingo on command-line.
Shell environment (telnet or ssh) on our server for those who can’t get their environment running or boot from our usb stick.
 
Process:We start off with a brief explanation of the benefits, and demonstrate a small example. After that we work from painting by numbers exercises in pairs, interspersed with debriefs (show & tell) by the participants. Gradually we increase the difficulty level. At the end we will debrief to let the participants reflect on what they can apply to their day jobs from this session.
 
Detailed timetable: - 00:00 - 00:05: Welcome
- 00:05- 00:15: Intro to Declarative Programming
- 00:15-00:20: Demo: Tweety
- 00:20-00:40: Family Relations
- 00:40-01:00: Graph Colouring
- 01:00-01:30: Sudoku
- 01:30- 02:00: Music
- 02:00 - 02:30 Debrief & reflection

The music exercise is optional, depending on how fast participants at SPA go through the material and how much need for debrief in between there is.
 
Outputs:This is a one off. We hope to do a trial run before of this configuration, possibly for the BrisFunctional or the Bristol ACCU group.
Most exercises have been used in courses on logic programming.
 
History:This session will be developed exclusively for SPA.
 
Presenters
1. Willem van den Ende
Living Software B.V.
2. Marina De Vos
University of Bath
3.