• Keine Ergebnisse gefunden

• Building Knowledge-Based Systems with PROLOG – First Steps

N/A
N/A
Protected

Academic year: 2022

Aktie "• Building Knowledge-Based Systems with PROLOG – First Steps "

Copied!
5
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

2. PROLOG for Knowledge Representation (KR) / Processing (KP) – Introduction

Objectives of this class:

Introduction into Logic Programming

Building Knowledge-Based Systems with PROLOG –

First Steps

(2)

PROLOG as a Programming Language – Brief History

• Founded in 1970-71 by A. Colmerauer, Marseilles

(“PROgrammation en LOGique” – PROgramming in LOGic).

• First implementation under Philippe Roussel in 1972.

• In the late Eighties of the last century, the language of XS and AI (Artificial Intelligence).

• A non-deterministic and typeless language, mostly interpretative implemented.

• Strong interest from declarative programming, software engineering, and knowledge processing (XS).

• Also used for software and test specification, prototyping,

constraints, natural language processing, VLSI design, etc.

(3)

Clauses and Terms – Syntax

• PROLOG programs consist of

clauses (called also statements), and – terms.

Both clauses and terms can have arguments.

• Clauses can be

procedure definitions

facts,

rules

procedure calls:

queries.

• Terms form (are used in) clauses, and can be (incomplete list) – variables (start with upper case letters)

– constants (start with lower case letters)

• atoms: predicates, operators, …

• Integers

– trees, and – lists

(4)

Clauses

• Clauses can (should) be sequenced and executed arbitrarily (also concurrently) – leading to the results when interpreted (non-deterministic execution, but

determinable result).

• Clauses end with “.” (dot).

• They consist of literals (predicates

• Control structures in PROLOG are

– sequential/concurrent execution/interpretation, – binding,

– backtracking,

– CUT (“!”), Univ (“=..”), – Input / output

– ...

• Writing a PROLOG program is writing the clauses (procedure definition(s)).

• Running (executing) a PROLOG program is asking questions (query/queries).

• When executed, a PROLOG program – verifies an assumption, or

(5)

Examplesfor facts:

is_female(utta). /* could mean: “Utta is female.” */

loves(utta, otto). /* could mean: “Uttas loves Otto.” */

are_parents(utta, gustav, otto).

/* could mean: “Utta and Gustav are parents of Otto.” */

are_parents(utta, gustav, utta).

/* could mean: “Utta and Gustav are parents of Utta.” */

Examplesfor rules:

is_sister(Sister, Sistered) :- /* Sister is sister of Sistered if -- */

is_female(Sister), /* Sister is female and */

are_parents(Ma, Pa, Sister), /* Ma/Pa is mother/father of Sister */

are_parents(Ma, Pa, Sistered). /* Ma/Pa is mother/father of Sistered */

Examplesfor queries:

?- is_female(utta).

true. /* confirm */

?- is_female(otto).

fail. /* refute */

?- is_sister(utta, otto).

true ; fail.

?- is_sister(otto, utta).

But also answer generation (instantiation) possible:

?- is_sister(OTTOS_SCHWESTER, otto).

OTTOS_SCHWESTER=utta ; /* Answer generation */

fail. /* weitere Schwester? */

Referenzen

ÄHNLICHE DOKUMENTE

KAOS were used in running the example ‘@RunningSurgery’ on the safety side in respect to both the information safety risk management (ISRM) [Firesmith, 2003] domain model and

In this paper, we illustrate the usefulness of NLP for CALL based on the presentation of three NLP tools 1 designed for French and integrated within a CALL software, namely: (i)

Recent advances in natural language processing have made it possible to process textual software requirements automatically, for example checking them for flaws or translating them

Abstract: Regression testing, a methodology originally developed for software development, is used to revalidate a (software) system in-between release cycles after having

kßâJÞs$À$sðàÁ&ò¬é' ïócëÄîÄëíò¬ï“ò¬æ

[r]

,.-EE0/ 1XL RFL RF^FTFL`VS%243365%7 a9I`VjLHM%I QKFL VOPJbI R]E%G_WE%ERHa:EL GDFVENPI Z OPM%JL RF^iGEVQOPRFI NPI Z`OPMLNNPI Z`OPMJ,EQKFNPIY E%^hOPR[lRFI_UNPE^FZ`E.

[r]