horn clause
a logical disjunction of literals, where at most one of the literals is positive, and all others are negative
logic programming
describe what you want as an answer and the language will figure it out for you or say ‘no’
a logic program is typically a set of constraints for a search algo
Japan’s Fifth Generation Computer Systems project
tried to use logic languages for general purpose computing
logic language uses
unification
a mechanism for matching symbolic expressions by finding a substitution for variables that makes two terms identical
prolog
express program and data through
* facts
* relations
* inference rules
prolog: atom
lower case first letter
e.g. fred
a constant
prolog: variable
upper case first letter
e.g. Fred
prolog: structure
relation(subject, object)
e.g. married(fred, wilma)
can have multiple elements f(a, b, c, d)
prolog: fact
unconditional relation
e.g. married(fred, wilma)
prolog: rule
conditional relation
e.g. grandparent(A, C) :- parent(A, B), parent(B, C)
prolog: query
ask if a sequence of terms is related
e.g. grandparent(X, Y) asks if X is a grandparent of Y based on defined rules
the result is the conditions required for the query to be true, e.g. values of X and Y
backtracking
if we don’t like a solution we can ask for the next and continue walking the proof tree until there are no more
ASP motivation
ASP uses