12.07.2015 Views

Logik und Logische Programmierung Einführung

Logik und Logische Programmierung Einführung

Logik und Logische Programmierung Einführung

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Logik</strong> <strong>und</strong> <strong>Logische</strong> <strong>Programmierung</strong>Einführung!Michael Leuschel!!Softwaretechnik <strong>und</strong> Programmiersprachen!04/04/2011!Lecture 1


Übersicht! (Mathematische) <strong>Logik</strong>→ <strong>Logische</strong> <strong>Programmierung</strong>→ Prolog! Warum?!• Theorie <strong>und</strong> Praxis! Was ?!• Übersicht über das Lehrmaterial! Wie ?!• Klausuren,..!• Übungen, ...!


Teil 1:!(Mathematische)<strong>Logik</strong>Gregor Reisch, „Die <strong>Logik</strong> präsentiert ihre zentralen Themen“,Margarita Philosophica, 1503/08 (?). Die beiden H<strong>und</strong>e veritas <strong>und</strong>falsitas jagen den Hasen problema, die <strong>Logik</strong> eilt mit dem Schwertsyllogismus bewaffnet hinterher. Links unten Parmenides, mit dem dielogische Argumentation Einzug in die Philosophie hielt, in einer Höhle.Quelle: Wikipedia.de


<strong>Logik</strong>: Wikipedia!<strong>Logik</strong> (griechisch ἡ λογική (τέχνη) he logiké téchne „die denkende[Kunst, Vorgehensweise]) ist die Lehre des vernünftigen (Schluss-)Folgerns.Die <strong>Logik</strong> untersucht die Gültigkeit von Argumenten hinsichtlich ihrerStruktur unabhängig vom konkreten Inhalt der eigentlichenAussagen. In diesem Sinne spricht man auch von „formaler <strong>Logik</strong>.Die <strong>Logik</strong> ist sowohl ein Teilgebiet der Philosophie als auch derMathematik <strong>und</strong> der Informatik.Seit dem 20. Jahrh<strong>und</strong>ert versteht man unter <strong>Logik</strong> überwiegendsymbolische <strong>Logik</strong>. Diese baut auf einer künstlichen Sprache auf <strong>und</strong>verwendet streng definierte Schlussregeln. Ein einfaches Beispiel fürein solches formales System ist die Aussagenlogik. Die symbolische<strong>Logik</strong> nennt man auch mathematische <strong>Logik</strong> oder formale <strong>Logik</strong> imengeren Sinn. Die <strong>Logik</strong> hatte nicht immer eine in diesem Sinnformale Struktur, sondern befasste sich in der Antike <strong>und</strong> imMittelalter überwiegend mit natürlichsprachlichen Argumenten.


(Mathematische) <strong>Logik</strong>! Auch symbolische <strong>Logik</strong> genanntAbgrenzung zur “philosophischen <strong>Logik</strong> ! Mathematical logic, then, is a branch ofmathematics which has much the same relationto the analysis and criticism of thought asgeometry has to the science of space! ! ! !Haskell B. Curry, 1963!


Warum <strong>Logik</strong> studieren ?! Wichtiger Zweig der Mathematik! Was ist Wahrheit? Was ist ein Beweis ?! Wissensdarstellung + intelligentes Denken! Künstliche Intelligenz (artificial intelligence),knowledge-based systems, expert systems, naturallanguage <strong>und</strong>erstanding, semantisches Web, ...! Überlegungen über Programme! Verifikation, statische Analyse, Optimierung,…! Hardware! Universale Vorrichtung der Berrechnung:! <strong>Logische</strong> <strong>Programmierung</strong>, Prolog, …!


Verschiedene <strong>Logik</strong>en! Aussagenlogik (propositional logic)! Prädikatenlogik der ersten Stufe (predicatelogic, first-order logic FOL)! <strong>Logik</strong> höherer Stufe (HOL)! Temporale <strong>Logik</strong> - Modallogik! Mehrwertige <strong>Logik</strong>en, Fuzzy <strong>Logik</strong>! Nichtmonotone <strong>Logik</strong>en! Relevanzlogik, lineare <strong>Logik</strong>! ...!


ains rains → carry_umbrella Aussagenlogik!rains ∨¬ rains p ∨¬ p Questions to the Audience:! Was ist die Sprache?! Beweistheorie!• Was gibt es an Axiomen ?!• Was gibt es an Inferenzregeln?! Modelltheorie!• Wie können wir Formeln mit der realen Weltverknüpfen?!


Syntax der Aussagenlogik Junktoren Und (Konjunktion): ∧ Oder (Disjunktion): ∨ If then (Implikation): → Äquivalenz: Nicht (Negation): ¬ . . . Äquivalenz, exclusives Oder, . . . Aussagen Bezeichner: p q rains ... Andere Zeichen: Klammern ( )05/04/2011


Logic Teaser Ritter: sagen immer dieWahrheit Schurken: lügen immer 1: A sagt: B ist ein Schurkeoder C ist ein Schurke 2: B sagtA ist ein Ritter Was sind A & B & C?05/04/2011


Darstellung in Aussagenlogik! (A_Ritter (¬B_Ritter or ¬C_Ritter))∧(B_Ritter A_Ritter )!1: A sagt: B ist ein Schurkeoder C ist ein Schurke2: B sagtA ist ein Ritter


Interpretation einer Formel! Jede Aussage bekommt Wert {T,F}! Verknüpfungstabelle:! Formel bekommt einen Wert {T,F}basierend auf dem Wert der Argumente! Modell einer Formel :!! Interpretation die die Formel wahr macht!


Truth Tables! " ¬! ! # " ! $ " ! % " ! & "true true false true true true truetrue false false false true false falsefalse true true false true true falsefalse false true false false true true05/04/2011


Arten von Formeln! Tautologie! Nur Modelle! Erfüllbare Formel! Mindestens ein Modell! Widerspruch:! Kein Modell! Äquivalenz von Formeln ? Definition vonSchlussfolgerung?!


Äquivalenz, <strong>Logische</strong> Folge! A <strong>und</strong> B sind äquivalent (AB) genaudann wenn sie die gleichen Modellehaben! B ist eine Schlussfolgerung von A (A |= B)genau dann wenn alle Modelle von Aauch Modelle von B sind!


Eine Beweistheorie derAussagenlogik!Im Kurs werden wir eine andere Technik sehen(Gr<strong>und</strong>lage von Prolog + SAT Solver)


Aussagenlogik!Problemif(x==null) {search(x.value)…}FormelIn AussagenlogikSAT Solver


Kurze Geschichte I!350 v.Chr.18791910Gründungder <strong>Logik</strong>Leibniz,Boole,CantorMathematische<strong>Logik</strong>AristotelesFregeRusselWhitehead


TheoremKurze Geschichte II!GödelsUnvollständigkeitssatzTuring:UnentscheidbarkeitGödelsVollständig-keitssatzDie Vollständigkeit der Axiome deslogischen Funktionen-kalküls."Monatsh. für Math. Phys. 37, 1930!Über formal unentscheidbare Sätzeder Principia Mathematica<strong>und</strong> verwandter Systeme I.Monatsh. Math. Phys., 38, 1931Satz vonHerbrandSur la non-contradiction de l’arithmetique.Journ. für die reine angew. Math., 166, 1931On Computable Numbers, with an Applicationto the Entscheidungsproblem.!Proc. London Math. Soc., 42, 1936-7!193019311936


Kursinhalte für <strong>Logik</strong>! Aussagenlogik! Einführung, Refutationsbeweis, Resolution! SAT-Solver <strong>und</strong> Anwendungen (neu)! Prädikatenlogik! Gr<strong>und</strong>lagen! Unifikation, Resolution, automatischesBeweisen! Je nach Interesse auch fortgeschritteneThemen (Gödel,…)!


Teil 2:<strong>Logische</strong> <strong>Programmierung</strong> &Prolog!


Übersicht von Teil 2 ! Prologs Syntax <strong>und</strong> Datenstrukturen! Erster Eindruck von Prolog!! “The Power of Prolog”! Live Demo !! Es funktioniert !!


Kurze Geschichte III!Predicate Logic as aProgramming LanguageResolutionA Machine-oriented Logic Basedon the Resolution Principle.Journal of the ACM (12),1965Linear Resolution withSelection Function.Proc. IFIP Congress,1971Prolog:Programmation en Logique196519711972RobinsonKowalskiColmerauer


Kurze Geschichte der logischen<strong>Programmierung</strong>! Erf<strong>und</strong>en in 1972! Colmerauer (Implementierung,! !Prolog = PROgrammation en LOGique)! Kowalski (Theorie)! Erkenntnis: Untermenge der Prädikatenlogik! Effiziente prozedurale Interpretation basierend aufResolution (Robinson 1965 + Herbrand 1931)! Programm = Theorie! Berechnung = logisches Schließen (Inferenz)!


Klassische vs <strong>Logische</strong> <strong>Programmierung</strong>!AlgorithmusDeduktion


Operational Reading of Logic!∀F,G,U,V. dx(F+G, U+V) ← dx(F,U) ∧ dx(G,V)!Logical meaning:!“If U is the derivative of F and V the derivative of Gthen U+V is the derivative of F+G”!Operational reading:!“To calculate the derivative of F+G one should firstcalculate the derivatives of F and G and composethe results”!Simple (incomplete) translation to C:!void dx(in,out) { match(in,’+’,f,g);dx(f,u); dx(g,v); construct(out,’+’,u,v); }!


OVERLOAD BREAKAGE – CHIP LOAD PER TOOTH ISOVERLOADING THE CUTTER, WHICH RESULTS IN TOOL BREAKAGE.PART NUMBER – THE NUMBER USED TO DESIGNATE A SPECIFICTOOL DIAMETER AND DESIGN FOR PRINT, TRAVELER, CATALOG ANDWARRANTY FILING AND REFERENCE.RADIAL LOAD – THE HORIZONTAL DEPTH OF CUT PARALLEL TO THECENTER LINE OF THE CUTTING TOOL, NORMALLY EXPRESSED IN APERCENTAGE OF THE DIAMETER OF THE TOOL.RAKE – THE ATTACK ANGLE OF THE TOOL.(SEE PAGE 5 RAKE AND CLEARANCE)RELIEF – (SEE CLEARANCE) THE RESULT OF THE REMOVAL OF TOOLMATERIAL DIRECTLY BEHIND OR ADJACENT TO THE CUTTING EDGE TOPROVIDE CLEARANCE AND PREVENT RUBBING (HEEL DRAG). IN THEINTEREST OF CONFORMITY, RELIEF IS THE ASME PREFERRED TERM FORWHAT ONSRUD CUTTER REFERS TO AS “PRIMARY CLEARANCE”. ITGENERALLY LIES WITHIN THE FIRST 1/16” DIRECTLY BEHIND THECUTTING EDGE AND IS EXPRESSED IN ANGLE AND LAND WIDTH.RIGHT HAND CUT – A TOOL WITH FLUTES AND CUTTING EDGESSPIRALING RIGHT. CLOCKWISE ROTATION.SE COMPRESSION – UP DOWNS OR 1+1 UP DOWNSSHANK – THAT PROJECTING PORTION OF A ROUTER BIT OR OTHEREND MILL WHICH LOCATES AND DRIVES THE ROUTER BIT IN THEMACHINE SPINDLE ON ADAPTER.SPINBACK – A SECTION OF REDUCED DIAMETER FROM THECUTTING EDGE AT THE FLUTE FADE OUT AND/OR A PORTION OF THESHANK OF THE ROUTER BITSPIRAL – A TOOL WITH HELICAL CUTTING EDGES AND FLUTES.TANGENT OF AN ANGLE – IN A RIGHT TRIANGLE IT IS THE RATIOOF THE SIDE OPPOSITE THE ANGLE TO THE SIDE ADJACENT. A LINE THATTOUCHES A CIRCLE AT ONE SPECIFIC POINT ONLY ALONG ITSCIRCUMFERENCE.TAPER – THE UNIFORM INCREASE OR DECREASE OF A TOOLSDIAMETER TO FORM A CONICAL OR WEDGE SHAPE – SPINDLES –TOOL HOLDER.TRANSVERSE RUPTURE STRENGTH (TRS) – THE BREAKINGSTRENGTH IN STANDARD BENDING TESTS (SIDE PRESSURE STRENGTH).UPCUT – A CUTTING EDGE HELIX THAT SPIRALS WITH TOOLROTATION. IT IS DESIGNED TO FORCE CHIP REMOVAL UP AND OUT OFTHE ACTIVE CUTTING AREA.V-FLUTE – OFTEN CALLED Z-FLUTE WITH DE TOOLSWEAR LAND – THE AREA JUST BEHIND THE CUTTING EDGE RESULT-ING FROM THE NORMAL DULLING REACTION. FORMS A BRIGHT SHINYFINISH BEHIND THE CUTTING EDGE AND IS A GOOD INDICATOR TOCHANGE THE TOOL OUT.WEB – THE BODY MATERIAL ABOUT THE TOOL AXIS ON CENTER THATREMAINS AFTER FLUTING AND CONNECTS THE WINGS.WELDON SHANK – A STRAIGHT SHANK WITH SPECIAL FLATS FORDRIVING AND LOCATING THE TOOL.WING – THE BODY MATERIAL THAT TERMINATES THE WEB ANDCONTAINS THE FLUTE FACE, CUTTING EDGE, CLEARANCE LAND,AND HEEL.SPINDLE – A PRECISION BEARING MOUNTED STEEL SHAFTUSED TO TRANSFER MOTOR POWER AND RETAIN ARBOR, COLLET ANDWORK PIECES.29OnsrudCutter


Console | ?- rains.Source File carry_umbrella :- rains.rains.human(sokrates).human(schopenhauer).human(locke).tiger(hobbes).mortal(X) :- human(X).mortal(X) :- animal(X).animal(X) :- tiger(X).yes| ?- carry_umbrella.Yes| ?- animal(sokrates).no| ?- animal(X).X = hobbes ?yes| ?- mortal(X).X = sokrates ? ;X = schopenhauer ? ;X = locke ? ;X = hobbes ? ;no


Prologʼs Syntax! Facts!human(socrates).! Rules (clauses)!carry_umbrella :- rains,no_hat.! Variables!mortal(X) :- human(X).!exists_human :- human(Any).! Queries!?- mortal(Z).!← (implication) universal variable (∀) ∧ (conjunction) existential variable (∃)


Prologʼs Datastructures! Constants:!human(socrates).! Integers, Reals:!fib(0,1).pi(3.141).!lower-case functor (Compo<strong>und</strong>) Terms:!left_of_tree(tree(L,R),L).!right_of_tree(tree(L,R),R).!?- left_of_tree(tree(leaf(2),leaf(3)),R).!


Lists in Prolog! Empty list:! [] ! (syntactic sugar for nil )! Non-Empty list with first element H and tail T:! [H|T] ! (syntactic sugar for .(H,T) )! Fixed-length list:! [a] ! (syntactic sugar for [a | [] ] = .(a,nil) )! [a,b,c] ! (syntactic sugar for [a | [b | [c | [] ] ] ] )!


Execution Model: Picture!if subgoal succeeds, move right query fails human(X), honest(X).query succeeds if subgoal fails, backtrack to the left


Practical Advantages! Automatic Memory Management! you will see no pointers! Relational/databases: travel demo ! Partially specified data, nondeterminism,multipleuses: append demo! Powerful matching: regular expression demo,tree tiling demo! Backtracking, search: puzzle demo, graphcolour demo, nfa/dfa! Language processing: parser demo!


Labyrinth!sol(T) :- ls(T),sol(T,1,1).!sol([],4,6).!sol([right|T],R,C) :- go_right(R,C), C1 is C+1, sol(T,R,C1).!sol([left|T],R,C) :- C1 is C-1, go_right(R,C1), sol(T,R,C1).!sol([down|T],R,C) :- go_down(R,C), R1 is R+1, sol(T,R1,C).!sol([up|T],R,C) :- R1 is R-1, go_down(R1,C), sol(T,R1,C).!ls([]).!ls([_|T]) :- ls(T).!


Truth Table in Prolog! Prolog: 17 Clauses, 36 lines ! One Java Solution (with GUI): 20Files, 3180 Lines! Good Java Solution: 4 Files, 184Lines; does not deal with =>, ! See if you can find the logic laws?! Could you add a new connective?!


:- op(300,fx,'~').!:- op(400,xfy,'&').!:- op(500,xfy,'or'). /* Note: + has 500, * has 400 as priority */!:- op(600,xfy,'=>').!:- op(700,xfy,'').!:- use_module(library(terms),[term_variables/2]).!enum([]).!enum([H|T]) :- (H=t ; H=f), enum(T).!print_vars([]) :- print('||').!print_vars([H|T]) :- print('|'),print(H),!print_vars(T).!!analyze(Formula) :- term_variables(Formula,Vars), numbervars(Formula,0,_),!print_vars(Vars), print(Formula),nl,fail.!analyze(Formula) :- term_variables(Formula,Vars),!enum(Vars), print_vars(Vars),!truth_value(Formula,TF), print(TF), nl,!fail.!analyze(_) :- nl.!!truth_value(t,t).!truth_value(f,f).!truth_value(~ X, T) :- truth_value(X,TX), neg(TX,T).!truth_value(X & Y, T) :- truth_value(X,TX), truth_value(Y,TY), and(TX,TY,T).!truth_value(X or Y, T) :- truth_value(X,TX), truth_value(Y,TY), or(TX,TY,T).!truth_value(X => Y, T) :- truth_value(~X or Y, T).!truth_value(X Y, T) :- truth_value(X & Y or ~X & ~Y, T).!neg(f,t). neg(t,f).!and(f,_,f). and(t,f,f). and(t,t,t).!or(t,_,t). or(f,f,f). or(f,t,t).!Prolog


TruthTable.javafor (Permutator p = new Permutator(ids.size()); p.hasNext();) { !! !Mapmap=newTreeMap();! ! !boolean[] values = p.next();! ! !for (int i = 0; i < values.length; i++) {! ! ! !map.put(ids.get(i), values[i]);! ! ! !System.out.print(values[i] "\t"); +! ! !} ! !!System.out.println("| " + evaluator.evaluate(ast, map));! !} !} !private static Stringconcatenate(String[] args) { ! !if (args.length == 0)! ! !return ""; !!StringBuffer result = new StringBuffer(); !!for (int i = 0; i < args.length - 1; i++) { !! !result.append(args[i] + " "); !package de.jastram.truthtable;import java.io.IOException;import!} ! !result.append(args[args.length - 1]);java.io.PushbackReader;import java.io.StringReader;import java.util.List;import! !return result.toString(); !}}java.util.Map;import java.util.TreeMap;importde.jastram.truthtable.lexer.Lexer;importde.jastram.truthtable.lexer.LexerException;importde.jastram.truthtable.node.Start;importde.jastram.truthtable.parser.Parser;importde.jastram.truthtable.parser.ParserException;/** * Program that takes a logicexpression on the command line and evaluates it * with all interpretations. */public class TruthTable { !public static void main(String[] args) throwsLexerException, IOException, ! !!ParserException{ ! !Stringarg=concatenate(args);! !PushbackReaderin=newPushbackReader(newStringReader(arg));! !Parser parser = new Parser(new Lexer(in));! !Start ast = parser.parse(); !!List ids = new IdCollector().getIds(ast); !!Evaluatorevaluator=newEvaluator(); !!for(Stringid:ids){! ! !System.out.print(id + "\t");! !} ! !System.out.println("|"+arg);! !System.out.println("=============================================="); ! !!


Permutator.javapackage de.jastram.truthtable;import java.util.Iterator;/** * AnIterator that provides permutations for n boolean values, where n isthe * argument to the constructor. The results are provided as booleanarrays. */public class Permutator implements Iterator {!private int length; !private int counter = 0;!publicPermutator(intnumFields){ !!if(numFields>31)! ! !throw new IndexOutOfBo<strong>und</strong>sException("Too many variables!"); ! !this.length =numFields; !} !public boolean hasNext() { !!return counter < (Math.pow(2, length)); !}!public boolean[] next() { ! !boolean[]bits = new boolean[length]; ! !for (int i = 0; i >i; ! ! !bits[i] = (shift % 2 == 1);! !} ! !counter++; !!return bits; !} !public void remove() {! !throw new UnsupportedOperationException();!}}!


IdCollector.javapackage de.jastram.truthtable;import java.util.ArrayList;importjava.util.List;importde.jastram.truthtable.analysis.DepthFirstAdapter;importde.jastram.truthtable.node.Start;importde.jastram.truthtable.node.TId;/** * This Visitor collects all distinctIds. */public class IdCollector extends DepthFirstAdapter {!privateList ids = new ArrayList(); !public ListgetIds(Start ast) { ! !ast.apply(this); !!returnids;!} !@Override !publicvoidcaseTId(TIdnode){! !if (!ids.contains(node.getText())) !! !ids.add(node.getText()); !!super.caseTId(node); !}}!


Evaluator.javapackage de.jastram.truthtable;import java.util.Map;importjava.util.NoSuchElementException;import java.util.Stack;importde.jastram.truthtable.analysis.DepthFirstAdapter;importde.jastram.truthtable.node.AAndExpr;importde.jastram.truthtable.node.ANegTerm;importde.jastram.truthtable.node.AOrExpr;importde.jastram.truthtable.node.Start;import de.jastram.truthtable.node.TId;/** *This Visitor Evaluates an AST for a Set of given values. */public classEvaluator extends DepthFirstAdapter { !private Stack stack = newStack(); !private Map values; !publicboolean evaluate(Start ast, Map values) { !!this.values = values; ! !ast.apply(this);! !return stack.pop(); !} !@Override!public void caseTId(TId node) { ! !Booleanvalue = values.get(node.getText()); ! !if (value == null)! ! !throw new NoSuchElementException("Don'tknow id: " + node); ! !stack.push(value); !!super.caseTId(node); !} !@Override !public voidcaseANegTerm(ANegTerm node) { ! !super.caseANegTerm(node);! !boolean value = stack.pop(); !!stack.push(!value); !} !!!@Override !public void caseAAndExpr(AAndExpr node) { !!super.caseAAndExpr(node); !!boolean value1 = stack.pop();! !boolean value2 = stack.pop();! !stack.push(value1 & value2);!} @Override !public voidcaseAOrExpr(AOrExpr node) { !!super.caseAOrExpr(node); !!boolean value1 = stack.pop();! !boolean value2 = stack.pop();! !stack.push(value1 | value2);!}}!Where are the logic laws ?


But Prolog will not be as fastRight ?


Geschwindigkeit, Fib Rekursiv! Java (BigInteger)! Fib(25), 121393, Zeit 90 ms! Fib(30),1346269, Zeit 632 ms! Fib(35), 14930352, Zeit 7030 ms! SICStus Prolog 4! | ?- main.! 25 : 121393 ; Time = 20 ms!! 30 : 1346269 ; Time = 250 ms!35 : 14930352 ; Time = 2750 ms!


LIPS! Logical Inferences per Second! On MacBook Pro 2,33 GHz:!$ sicstus4 -l bench.pl --goal "bench(100000)."% compiling /Users/leuschel/PrologTemp/bench.pl...% compiled /Users/leuschel/PrologTemp/bench.plin module user, 10 msec 4604 bytesSICStus 4.0.1 (i386-darwin-8.9.1): Tue May 15 14:53:23 CEST 2007Licensed to SP4phil-fak.uni-duesseldorf.de33288590.604026847 lips for 100000iterations taking 1490 msecs (1500-10)


Logic Programming useful for!! Software Engineering/Mission CriticalSystems! Mercury, Program Analysis! Artificial Intelligence Applications:! Expert Systems, Natural Language Processing,Intelligent Agents, ...! Operations Research, Optimisation,Planning! Constraint Logic Programming! Programming Languages! Parsers, Compilers, Domain-Specific Languages(Erlang), Analysis, Verification, Rapid Prototyping...!


Opening (25 May 2009)!TEN DECLARATIVE PROGRAMMING CONSULTANTS SOUGHT!Semmle and LogicBlox are creating a platform for declarativeprogramming in Datalog, a purelogic programming language.Semmle is based in Oxford, headed by Oege de Moor;LogicBlox isbased in Atlanta, headed by Molham Aref.To configure our solution at a number of largecorporateclients in the retail, insurance and software qualityindustries, we urgently require 10full-time staff to act as consultants. These consultants will work with clients to write customqueries in Datalog, and to create user interfaces in a declarative framework.This is a uniqueopportunity to change the way enterprise software is constructed, and to become part of therevolutionto adopt declarative programming in mainstream applications.Semmle and LogicBloxoffer a vibrant, intellectuallystimulating environment to work on exciting applications ofcuttingedgetechnology.!Requirements:You must be passionate about simplifying the constructionof complex softwaresystems. A good <strong>und</strong>ergraduate degree in computer science or related discipline is necessary.Substantial programming experience, and familarity with declarative programming (bothfunctional and logic) is a must. Some travel will be required.Starting date and renumeration:Theopenings are available immediately. The renumeration dependson experience andqualifications; it is especially competitive for recent graduates.!Further information:To find out more about this opportunity, write toOege de Moor(oege@semmle.com) and Molham Aref (molham@logicblox.com).!To apply:Send a CV and the names of three referees (at least two ofwhom must be able tocomment on your programming abilities)to recruit@semmle.com, by June 12.!


Learning Outcome! Option 1:Prolog will become your favourite language! Option 2:It will not become your favourite language!!Prolog still useful:! Rapid prototyping! Prolog interpreter as part of application(Windows NT)! Implicit in your application (Unification/Matching,Search, Backtracking,…)! Semantic Web!


Backgro<strong>und</strong> Material! Ulf Nilsson and Jan Maluszynski, Logic,Programming and Prolog, Wiley & Sons, 1990.Covers logic, logic programming, pure Prolog.! Patrick Blackburn, Johan Bos and Kristina Striegnitz,Learn Prolog Now! Arbeitsbuch Prologhttp://www.informatik.uni-rostock.de/mmis/courses/ss07/23002/arbeitsbuch_prolog.pdf! Ivan Bratko, Prolog Programming for ArtificialIntelligence, Addison Wesley, 1990! Clocksin & Mellish, Programming in Prolog, Springer-Verlag.! Sterling and Shapiro. The Art of Prolog. MIT Press.!


Summary! Logic, Logic Programming, and Prologare! Very useful for theory and practice! Fun and stimulating! Difficult(you will have to work hard!)!


Some Existing Prolog Systems! Prolog! SWI, IF, Visual (PDC) Prolog! Extended Prolog! Constraints: SICStus, CIAO, Eclipse, ...! Tabling: XSB Prolog! Purified Prolog! Mercury, Gödel! Integrated with Functional Programming! Curry, Babel, Escher!

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!