Intro

Transcrição

Intro
Logik und Logische Programmierung
Einführung
Michael Leuschel
Softwaretechnik und Programmiersprachen
Einführung in die logische
Programmierung
Wintersemester 2015
20/10/15
Vorlesung 1
Deklarative Programmierung
•  Deklarativ:
–  Was muss berechnet werden
–  logische/relationale Programmierung und
funktionale Programmierung
•  vs
•  Imperativ:
–  Wie muss etwas berechnet werden
–  C, Java, ...
Unless you have been living under a rock, you might have noticed a
programming paradigm shift in the last couple of years. These days, the
cool kids are all doing Functional Programming (FP) while embracing
immutable data structures, higher-order functions, and tail recursions.
You can't deny, that FP does have some really huge advantages over
Object-orientated Programming (OOP). Avoiding state, mutability and
side-effects is a big step towards more robust and less fragile applications,
especially in today's world, where even our mobile phones are equipped
with multi-core CPUs for parallelizing computations.
http://www.codenugget.co/2015/03/05/declarative-vs-imperative-programming-web.html
Declarative vs. Imperative
When you look on the internet for a definition, you might find something
like this (emphasis mine):
Any relational language or functional language. These kinds of
programming language describe relationships between variables in terms
of functions or inference rules, and the language executor (interpreter or
compiler) applies some fixed algorithm to these relations to produce a
result.
Declarative languages contrast with imperative languages which specify
explicit manipulation of the computer's internal state; or procedural
languages which specify an explicit sequence of steps to follow.
http://www.codenugget.co/2015/03/05/declarative-vs-imperative-programming-web.html
https://facebook.github.io/react/docs/why-react.html
Übersicht
•  (Mathematische) Logik
→ Logische Programmierung
→ Prolog
–  Warum?
•  Theorie und Praxis
–  Was ?
•  Übersicht über das Lehrmaterial
–  Wie ?
•  Klausuren,..
•  Übungen, ...
Teil 1:
(Mathematische)
Logik
Gregor Reisch, „Die Logik präsentiert ihre zentralen Themen“,
Margarita Philosophica, 1503/08 (?). Die beiden Hunde veritas und
falsitas jagen den Hasen problema, die Logik eilt mit dem Schwert
syllogismus bewaffnet hinterher. Links unten Parmenides, mit dem die
logische Argumentation Einzug in die Philosophie hielt, in einer Höhle.
Quelle: Wikipedia.de
Logik: Wikipedia
Logik (griechisch ἡ λογική (τέχνη) he logiké téchne „die denkende
[Kunst, Vorgehensweise]“) ist die Lehre des vernünftigen
(Schluss-)Folgerns.
Die Logik untersucht die Gültigkeit von Argumenten hinsichtlich ihrer
Struktur unabhängig vom konkreten Inhalt der eigentlichen
Aussagen. In diesem Sinne spricht man auch von „formaler“ Logik.
Die Logik ist sowohl ein Teilgebiet der Philosophie als auch der
Mathematik und der Informatik.
Seit dem 20. Jahrhundert versteht man unter Logik überwiegend
symbolische Logik. Diese baut auf einer künstlichen Sprache auf und
verwendet streng definierte Schlussregeln. Ein einfaches Beispiel für
ein solches formales System ist die Aussagenlogik. Die symbolische
Logik nennt man auch mathematische Logik oder formale Logik im
engeren Sinn. Die Logik hatte nicht immer eine in diesem Sinn
formale Struktur, sondern befasste sich in der Antike und im
Mittelalter überwiegend mit natürlichsprachlichen Argumenten.
(Mathematische) Logik
•  Auch symbolische Logik genannt
Abgrenzung zur “philosophischen Logik •  “Mathematical logic, then, is a branch of
mathematics which has much the same relation
to the analysis and criticism of thought as
geometry has to the science of space”
Haskell B. Curry, 1963
Warum Logik studieren ?
•  Wichtiger Zweig der Mathematik
–  Was ist Wahrheit? Was ist ein Beweis ?
•  Wissensdarstellung + intelligentes Denken
–  Künstliche Intelligenz (artificial intelligence), knowledgebased systems, Expertensysteme, natürliche Sprache
verstehen, semantisches Web, ...
•  Überlegungen über Programme
–  Verifikation, statische Analyse, Optimierung,…
•  Hardware
•  Universale Vorrichtung der Berrechnung:
–  Logische Programmierung, Prolog, …
Was beinhaltet eine Logik ?
1. Sprache der Ausdrücke und Formeln
2. Beweistheorie (proof theory)
–  Axiome : unabdingbar wahr, automatisch Theoreme
–  Inferenzregeln : um neue Theoreme von
existierenden abzuleiten (truth preserving
inference)
3. Modelltheorie (existiert nicht immer)
–  Abbildung von Ausdrücken auf “echte” Objekte, und
Verknüpfung mit Aussagen in der “echten” Welt
•  Logic = Studium der korrekten Inferenz/
Schlussfolgerung
Verschiedene Logiken
•  Aussagenlogik (propositional logic)
•  Prädikatenlogik der ersten Stufe (predicate logic,
first-order logic FOL)
•  Logik höherer Stufe (HOL)
•  Temporale Logik - Modallogik
•  Mehrwertige Logiken, Fuzzy Logik
•  Nichtmonotone Logiken
•  Relevanzlogik, lineare Logik
•  ...
2. Higher-Order Logic
∃ R. R(tom) → human(tom)
variables over objects and relations
1. First-Order Logic (Prädikatenlogik)
- constants, functions, variables
(tom mother(tom) X)
human(sokrates)
- relations
( human(.) married(. , .) )
∀ X. human(X) → mortal(X)
- quantifiers
(∀ ∃ )
variables over objects
0. Propositional Logic (Aussagenlogik)
rains
- propositions
rains → carry_umbrella
(basic units: either true or false)
- logical connectives
p ∨¬ p
rains ∨¬ rains
(∨ ∧ ¬ →)
no variables
rains
Aussagenlogik
rains → carry_umbrella
rains ∨¬ rains
•  Fragen:
–  Was ist die Sprache?
–  Beweistheorie
•  Was gibt es an Axiomen ?
•  Was gibt es an Inferenzregeln?
–  Modelltheorie
•  Wie können wir Formeln mit der realen Welt
verknüpfen?
p ∨¬ p
Syntax der Aussagenlogik
•  Junktoren
–  Und (Konjunktion): ∧
–  Oder (Disjunktion): ∨
–  If then (Implikation): →
–  Äquivalenz: ⇔
–  Nicht (Negation):
¬
–  . . . Äquivalenz, exklusives Oder, . . .
•  Aussagen
–  Bezeichner:
p
•  Andere Zeichen:
–  Klammern
19/10/15
(
)
q
rains ...
Ein kleines Puzzle
•  Ritter: sagen immer die
Wahrheit
•  Schurken: lügen immer
•  1: A sagt: “B ist ein Schurke
oder C ist ein Schurke”
•  2: B sagt“A ist ein Ritter”
•  Was sind A, B und C?
19/10/15
Darstellung in Aussagenlogik
•  (A_Ritter ⇔ (¬B_Ritter or ¬C_Ritter))
∧
(B_Ritter ⇔ A_Ritter )
1: A sagt: “B ist ein Schurke
oder C ist ein Schurke”
2: B sagt“A ist ein Ritter”
Interpretation einer Formel
•  JedeAussagebekommtWert∈{T,F}
•  Verknüpfungstabelle:
–  FormelbekommteinenWert∈{T,F}basierend
aufdemWertderArgumente
•  ModelleinerFormel:
–  Interpreta@ondiedieFormelwahrmacht
Truth Tables
αα
ββ
¬α
¬α
→ββ α ⇔ β
αα∧∧ββ αα∨∨ββ αα→
true
true
true
true
false
false
true
true
true
true
true
true
true
true
true
false
false
false
false
false
false
true
true
false
false
false
false
false
true
true
true
true
false
false
true
true
true
true
false
false
false
false
false
true
true
false
false
false
false
true
true
true
19/10/15
Arten von Formeln
•  Tautologie
–  Nur Modelle
•  Erfüllbare Formel
–  Mindestens ein Modell
•  Widerspruch:
–  Kein Modell
•  Äquivalenz von Formeln ? Definition von
Schlussfolgerung?
Äquivalenz, Logische Folge
•  A und B sind äquivalent (A≡B) genau
dann wenn sie die gleichen Modelle haben
•  B ist eine Schlussfolgerung von A (A |=
B)genau dann wenn alle Modelle von A
auch Modelle von B sind
Eine Beweistheorie der
Aussagenlogik
Im Kurs werden wir eine andere Technik sehen
(Grundlage von Prolog + SAT Solver)
Aussagenlogik
Problem
Formel
In Aussagenlogik
SAT Solver
if(x==null) {
search(x.value)
…
}
Kursinhalte für Logik
•  Aussagenlogik
–  Einführung, Refutationsbeweis, Resolution
–  SAT-Solver und Anwendungen (neu)
•  Prädikatenlogik
–  Grundlagen
–  Unifikation, Resolution, automatisches
Beweisen
•  Je nach Interesse auch fortgeschrittene
Themen (Gödel,…)
Teil 2:
Logische Programmierung &
Prolog
Übersicht von Teil 2
•  Prologs Syntax und Datenstrukturen
–  Erster Eindruck von Prolog
•  “The Power of Prolog”
–  Live Demo !
–  Es funktioniert !
Kurze Geschichte III
Predicate Logic as a
Programming Language
Resolution
A Machine-oriented Logic Based
on the Resolution Principle.
Journal of the ACM (12),1965
Linear Resolution with
Selection Function.
Proc. IFIP Congress,1971
Prolog:
Programmation en Logique
1965
1971
1972
Robinson
Kowalski
Colmerauer
Kurze Geschichte der logischen
Programmierung
•  Erfunden in 1972
–  Colmerauer (Implementierung,
Prolog = PROgrammation en LOGique)
–  Kowalski (Theorie)
•  Erkenntnis: Untermenge der Prädikatenlogik
–  Effiziente prozedurale Interpretation basierend auf
Resolution (Robinson 1965 + Herbrand 1931)
–  Programm = Theorie
–  Berechnung = logisches Schließen (Inferenz)
Klassische vs Logische Programmierung
Algorithmus
Deduktion
Reiz der logischen Programmierung
•  Deklarativ:
–  man beschreibt was berechnet wird, nicht wie
•  Die gleiche Sprache (Logik) für
–  Programme, Spezifikationen
–  Datenbanken, Anfragen,…
•  einfache, klare Semantik
–  Reasoning about correctness is possible
–  Enable powerful optimisations
Konsole
| ?- rains.
Source
carry_umbrella :- rains.
rains.
human(sokrates).
human(schopenhauer).
human(locke).
tiger(hobbes).
yes
| ?- carry_umbrella.
Yes
| ?- animal(sokrates).
no
| ?- animal(X).
X = hobbes ?
yes
| ?- mortal(X).
X = sokrates ? ;
mortal(X) :- human(X).
mortal(X) :- animal(X).
X = schopenhauer ? ;
animal(X) :- tiger(X).
X = hobbes ? ;
X = locke ? ;
no
Prologs Syntax
•  Fakten
human(socrates).
•  Regeln (clauses)
← (Implikation)
carry_umbrella :- rains,no_hat.
•  Variablen
∧ (Konjunktion)
mortal(X) :- human(X).
exists_human :- human(Any).
•  Anfragen (queries)
Variable (∃)
?- mortal(Z).universal quantifizierte Variable (∀)
Prologs Datenstrukturen
•  Konstanten:
Kleinbuchstabe
human(socrates).
•  Integers, Reals:
fib(0,1).
pi(3.141).
Funktor (functor)
•  (Compound) Terms:
left_of_tree(tree(L,R),L).
right_of_tree(tree(L,R),R).
?- left_of_tree(tree(leaf(2),leaf(3)),R).
Zusammenfassung
Datenstruktur
Prozedur/Prädikat
p
Konstante
Aussage
f(_,_,_)
Funktor=Record
(CompoundTerm)
Prädikat
X
Variable
(stehtfüreinebeliebige
Datenstruktur)
Aufrufeinesnochnicht
festgelegten
Prädikats(“Reflec@on”)
AuRommen:
AlsArgumentevon
PrädikatenundFunktoren
AnobersterEbeneineiner
Klausel
d/3
get(date,d(D,M,Y)) :- getdm(D,M), get(year,Y).
Prolog: Einzelne Aufrufe
•  Aufruf p(t1,...tn) (z.B. p(bus,Z))
–  Suche alle Klauseln die p mit n Argumenten definieren:
•  p(auto,f(X)) :- q(X).
•  p(bus,g(X)) :- r(X).
•  p(Y,h(Y)) :- s(Y,Z),r(Z).
–  Versuche Variablen in Aufruf und Klauselkopf zu ersetzen, so
dass Aufruf und Kopf gleich werden:
•  1. Klausel: nicht möglich, 2. Klausel: Z=g(X) à r(X)
–  mit Klauselrumpf weiterrechnen
–  falls keine Lösung möglich, weitere Klauseln ausprobieren:
•  3. Klausel: Y=b, Z=h(b) à s(b,Z),r(Z)
Ausführung von Konjunktionen
if subgoal succeeds, move right
query
fails
human(X), honest(X).
if subgoal fails, backtrack to the left
query
succeeds
Praktische Vorteile
•  Automatische Speicherverwaltung
–  keine Zeiger
•  Relational/Datenbanken: travel Demo
•  Partially specified data, nondeterminism,multiple uses: append Demo
•  Matching: regular expression Demo, tree tiling
Demo
•  Backtracking, Suche: puzzle Demo, graph
colour Demo, nfa/dfa
•  Sprachverarbeitung: parser Demo
Listen in Prolog
•  Leere Liste:
–  []
(“syntactic sugar” für nil )
•  Nicht-leere List mit H als 1. Element und Rest
(tail) T:
–  [H|T]
(syntactic sugar für .(H,T) )
•  Liste mit festgelegter Länge:
–  [a]
–  [a,b,c]
(syntactic sugar für [a | [] ] = .(a,nil) )
(syntactic sugar für [a | [b | [c | [] ] ] ] )
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 Klauseln, 36 Zeilen
•  1. Java Lösung (mit GUI): 20
Dateien, 3180 Zeilen
•  2. Java Lösung : 4 Dateien, 184
Zeilen; keine Unterstützung von =>,
ó
•  Wo sind die logischen Gesetze?
•  Wie kann man einen neuen Junktor
hinzufügen?
:- 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
|?-analyze((A<=>~Bor~C)&(B<=>A)).
|A|B|C||(A<=>~Bor~C)&(B<=>A)
|t|t|t||f
|t|t|f||TRUE
|t|f|t||f
|t|f|f||f
|f|t|t||f
|f|t|f||f
|f|f|t||f
|f|f|f||f
yes
TruthTable.java
for (Permutator p = new Permutator(ids.size()); p.hasNext();) {
Map<String,Boolean>map=newTreeMap<String,Boolean>();
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 String concatenate(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
}
java.io.PushbackReader;import java.io.StringReader;import java.util.List;import
result.append(args[args.length - 1]);
return
java.util.Map;import java.util.TreeMap;import
result.toString();
}}
de.jastram.truthtable.lexer.Lexer;import
de.jastram.truthtable.lexer.LexerException;import
de.jastram.truthtable.node.Start;import
de.jastram.truthtable.parser.Parser;import
de.jastram.truthtable.parser.ParserException;/** * Program that takes a logic
expression on the command line and evaluates it * with all interpretations. */
public class TruthTable { public static void main(String[] args) throws
LexerException, IOException,
ParserException{
Stringarg=concatenate(args);
PushbackReaderin=newPushbackReader(newStringReader(arg));
Parser parser = new Parser(new Lexer(in));
Start ast = parser.parse();
List<String> ids = new IdCollector().getIds(ast);
Evaluatorevaluator=newEvaluator();
for(Stringid:ids){
System.out.print(id + "\t");
}
System.out.println("|"+arg);
System.out.println("==============================================");
Permutator.java
package de.jastram.truthtable;import java.util.Iterator;/** * An
Iterator that provides permutations for n boolean values, where n is
the * argument to the constructor. The results are provided as boolean
arrays. */public class Permutator implements Iterator<boolean[]> {
private int length;
private int counter = 0;
publicPermutator(intnumFields){
if(numFields>31)
throw new
IndexOutOfBoundsException("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 < length; i++) {
int shift = counter >> i;
bits[i] = (shift % 2 == 1);
}
counter++;
return bits;
}
public void remove() {
throw new
UnsupportedOperationException();
}}
IdCollector.java
package de.jastram.truthtable;import java.util.ArrayList;import
java.util.List;import
de.jastram.truthtable.analysis.DepthFirstAdapter;import
de.jastram.truthtable.node.Start;import
de.jastram.truthtable.node.TId;/** * This Visitor collects all distinct
Ids. */public class IdCollector extends DepthFirstAdapter { private
List<String> ids = new ArrayList<String>();
public List<String>
getIds(Start ast) {
ast.apply(this);
returnids; }
@Override
publicvoidcaseTId(TIdnode){
if (!ids.contains(node.getText()))
ids.add(node.getText());
super.caseTId(node);
}}
Evaluator.java
@Override
public void
package de.jastram.truthtable;import java.util.Map;import
caseAAndExpr(AAndExpr node) {
java.util.NoSuchElementException;import java.util.Stack;import
super.caseAAndExpr(node);
de.jastram.truthtable.analysis.DepthFirstAdapter;import
boolean value1 = stack.pop();
de.jastram.truthtable.node.AAndExpr;import
boolean value2 = stack.pop();
de.jastram.truthtable.node.ANegTerm;import
stack.push(value1 & value2);
de.jastram.truthtable.node.AOrExpr;import
}
@Override
public void
de.jastram.truthtable.node.Start;import de.jastram.truthtable.node.TId;/** * caseAOrExpr(AOrExpr node) {
This Visitor Evaluates an AST for a Set of given values. */public class
super.caseAOrExpr(node);
Evaluator extends DepthFirstAdapter {
private Stack<Boolean> stack = new
boolean value1 = stack.pop();
Stack<Boolean>();
private Map<String, Boolean> values;
public
boolean value2 = stack.pop();
boolean evaluate(Start ast, Map<String, Boolean> values) {
stack.push(value1 | value2);
this.values = values;
ast.apply(this);
}}
return stack.pop();
}
@Override
public void caseTId(TId node) {
Boolean
value = values.get(node.getText());
if (value == null)
throw new NoSuchElementException("Don't
know id: " + node);
stack.push(value);
super.caseTId(node);
}
@Override
public void
caseANegTerm(ANegTerm node) {
super.caseANegTerm(node);
boolean value = stack.pop();
stack.push(!value);
}
Where are the logic laws ?
Geschwindigkeit von Prolog ?
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
•  MacBookAir 2.2GHz i7:
$ sicstus -l bench.pl --goal "bench(1000000)."
% compiling /Users/leuschel/svn_root/TEX/PrologTestFiles/bench.pl...
% compiled /Users/leuschel/svn_root/TEX/PrologTestFiles/bench.pl in module user, 80 msec
792784 bytes
SICStus 4.3.2 (x86_64-darwin-14.0.0): Fri May 8 10:06:06 CEST 2015
Licensed to SP4.3FormalMindLeuschelMac
163696369.6369637 lips for 1000000 iterations taking 3030 msecs (3060-30)
> 160 Millionen LIPS
Prolog nützlich für
•  Software Engineering/Mission Critical Systems
–  Mercury, Programmanalyse
•  Künstliche Intelligenz:
–  Expertensysteme, Natural Language Processing,
intelligente Agenten, ...
•  Operations Research, Optimisation, Planung
–  Constraint Logic Programming
•  Programmiersprachen
–  Parsers, Compilers, Domain-Specific Languages
(Erlang), Analysis, Verification, Rapid Prototyping...
Prolog,Parsing,KI
Opening (25 May 2009)
• 
• 
• 
• 
• 
TEN DECLARATIVE PROGRAMMING CONSULTANTS SOUGHT
Semmle and LogicBlox are creating a platform for declarativeprogramming in Datalog, a pure
logic programming language.Semmle is based in Oxford, headed by Oege de Moor;LogicBlox is
based in Atlanta, headed by Molham Aref.To configure our solution at a number of large
corporateclients in the retail, insurance and software qualityindustries, we urgently require 10 fulltime staff to act as consultants. These consultants will work with clients to write custom queries in
Datalog, and to create user interfaces in a declarative framework.This is a unique opportunity to
change the way enterprise software is constructed, and to become part of the revolutionto adopt
declarative programming in mainstream applications.Semmle and LogicBlox offer a vibrant,
intellectuallystimulating environment to work on exciting applications ofcutting-edge technology.
Requirements:You must be passionate about simplifying the constructionof complex software
systems. A good undergraduate degree in computer science or related discipline is necessary.
Substantial programming experience, and familarity with declarative programming (both functional
and logic) is a must. Some travel will be required.Starting date and renumeration:The openings
are available immediately. The renumeration dependson experience and qualifications; it is
especially competitive for recent graduates.
Further information:To find out more about this opportunity, write toOege de Moor
([email protected]) and Molham Aref ([email protected]).
To apply:Send a CV and the names of three referees (at least two ofwhom must be able to
comment on your programming abilities)to [email protected], by June 12.
TECHNOLOGY - ENTERPRISE
PLATFORMS - DEVELOPER
Basic Qualifications
•Team player, eager to work in a global organization
•Energy, self-motivation and independence to manage multiple tasks
•Programming expertise in one or more of the following languages: Python,
Ruby, Java, .NET, C++, Erlang (knowledge of Haskell, Lisp, Clojure, Scala
or Prolog is a strong plus)
•Analytical mindset, creativity and commercial focus to deliver optimal
solutions for the business
•Experience building and sustaining long-term relationships with clients and
colleagues
•Judgment to prioritize and escalate issues in order to influence objectives
and outcomes
•Strong oral and written communication skills
http://www.goldmansachs.com/a/data/jobs/35916.html?&bid=9993572
Lernergebnisse
•  Ergebnis 1:
Prolog wird ihre Lieblingssprache
•  Ergebnis 2:
Prolog wird nicht ihre Lieblingssprache
Prolog trotzdem nützlich für:
–  Prototypentwicklung
–  Prolog interpreter als Teil einer Anwendung
(Windows NT, React,...)
–  Implizit in der Anwendung (Unifikation/Matching,
Suche, Backtracking,…)
–  Semantisches Web
Literatur
–  Ulf Nilsson and Jan Maluszynski, Logic, Programming
and Prolog, Wiley & Sons, 1990.
PDF: http://www.ida.liu.se/~ulfni/lpp/
–  Patrick Blackburn, Johan Bos and Kristina Striegnitz,
Learn Prolog Now http://www.learnprolognow.org/
–  Arbeitsbuch Prolog
http://www.informatik.uni-rostock.de/mmis/courses/ss07/23002/arbeitsbuch_prolog.pdf
–  Ivan Bratko, Prolog Programming for Artificial
Intelligence, Addison Wesley, 1990
–  Clocksin & Mellish, Programming in Prolog, SpringerVerlag.
–  Sterling and Shapiro. The Art of Prolog. MIT Press.
Existierende Prolog Systeme
•  Prolog
–  SWI-Prolog http://www.swi-prolog.org
–  SICStus Prolog
–  Ciao Prolog
–  IF, Visual (PDC) Prolog
–  Constraints: gnuProlog, Eclipse, ...
–  Tabling: XSB Prolog
•  Purified Prolog
–  Mercury, Gödel
•  Integrated with Functional Programming
–  Curry, Babel, Escher
Zusammenfassung
•  Logik, logische Programmierung und
Prolog sind
–  sehr nützlich in Theorie und Praxis
–  eine Herausforderung
(Übung macht den Meister)
•  aber machen Spass

Documentos relacionados