• Nem Talált Eredményt

Semantic and Declarative Technologies

N/A
N/A
Protected

Academic year: 2023

Ossza meg "Semantic and Declarative Technologies"

Copied!
16
0
0

Teljes szövegt

(1)

Semantic and Declarative Technologies

AIT Budapest

Semantic and Declarative Technologies

AIT Budapest

Péter Szeredi

http://cs.bme.hu/~szeredi/ait/

Péter Szeredi

http://cs.bme.hu/~szeredi/ait/

(2)

Semantic? Declarative? What the hell…?

According to the Merriam-Webster dictionary:

Semantic (adjective):

relating to the meanings of words and phrases Declarative (adjective):

having the form of a statement

rather than a question or a command

And in conjunction with technology?

Semantic web:

let search engines understand the web, not just read it Declarative programming:

solve tasks by just describing the desired solution

Why together in the same course?

Common foundation: (mathematical) logic 2

(3)

Question: X? Answer: X?

3

(4)

A puzzle scheme from the book …

• Imagine an island on which every native is either

a knight – who always tells the truth; or a knave – who always lies

But they cannot be distinguished otherwise…

• If you hear Alf saying: “1+1=2”, he is a …

• If you hear Bob saying “1+1=3”, he is a …

• What if Cecil says: “I am a knight”?

Can Cecil be a knight? Can he be a knave?

• Can it happen that Dan says: “I am a knave”?

(5)

Puzzle # 28 from the book

• In this problem, there are two natives, A and B. A makes the following statement:

“At least one of us is a knave.” (*) What are A and B?

• Think of writing a program in your favorite programming language, which takes (*) or some similar text as input, and returns the solution(s)…

5

(6)

Let’s use “controlled English” input

<person> ::= A | B | C | …

<native> ::= knight | knave

<statement> ::= <person> is a <native> | <person> says <statement> |

<statement> and <statement> |

<statement> or <statement>

• “

A says: at least one of us is a knave.” becomes:

A says A is a knave or B is a knave

• Given this input format, how many lines of

code would the puzzle solver require in your

favorite programming language?

(7)

Prolog - Programming in logic (or English?)

• Prolog is a simple, yet very flexible programming language based on a subset of First Order Logic

• Examples (use syntax extensions, additional operators, etc.)

7

statements of a knight have truth value 1. % truth(knight, 1).

statements of a knave have truth value 0. % truth(knave, 0).

statement (Native1 is a Native2) evaluates to B if statements of a Native1 have truth value B1 and statements of a Native2 have truth value B2 and

B is 1-abs(B1-B2). % is is a built in for arithmetic, here B = 1 iff B1==B2 statement (Native1 says S) evaluates to B if

statements of a Native1 have truth value B1 and statement S evaluates to B2 and B is 1-abs(B1-B2).

statement (S1 or S2) evaluates to B if statement S1 evaluates to B1 and statement S2 evaluates to B2 and

B is B1 \/ B2. % B is the disjunction of B1 and B2

(8)

SWISH: a web environment for Prolog

(9)

Adding constraints to Prolog

• Constraint Logic Programming (CLP) – what is it?

It extends Prolog with much stronger reasoning capabilities for a limited data domain (e.g. integers, Booleans, etc.)

• CLPFD (CLP for Finite Domain) – very efficient solution of combinatorial problems, e.g.

Sudoku puzzles

7 4 2

1 9

1 9

1 1 1 1

9 9 9

5 3 8

5 3 3

6 8

7 4 2

1 9

1 9

1 1 1 1

9 9 9

5 3 8

5 3 3

6 8

9

(10)

The Semantic Web (SW) part of the course

• Description Logics (DL) – the maths behind SW

– DL variants with different complexity

– Transforming human knowledge to DL format – Reasoning algorithms (outline)

• The practical side of the Semantic Web

– OWL 2 (Web Ontology Language) – The Protégé editor and

reasoning framework

(11)

Course summary

Rough course layout:

Introduction to (First Order) Logic Weeks 1-2 Prolog programming Weeks 2-7

Constraint programming Weeks 8-12

Logics for the Semantic Web Weeks 12-14

Requirements:

2 assignments (15% each)30% total

2 tests (mid-term & final, 20% each) 40% total Many small exercises + class activity 30%

Course webpage:

http://cs.bme.hu/~szeredi/ait/

11

(12)

Abilities helpful for this course

• The ability of clean, logical formulation of one’s expectations of a function or a

procedure

• The ability to write recursive programs

• The acceptance of the single assignment

principle: a variable can be assigned a

value only once

(13)

Why should you attend this course?

• Learn a very different programming paradigm, which you can also use in other languages such as C, Java, etc.

• Learn techniques to quickly and concisely solve difficult algorithmic problems

• Learn Description Logics – the maths behind the next generation „intelligent" Web 3.0

• It’s a niche market – experts of declarative and semantic technologies enjoy high-paying jobs

13

(14)

Some real-life applications

Clarissa: natural voice processing used in systems on the International Space Station

NRM: network management system for

configuring multi-vendor IP backbone networks

ContractExpress: intelligent contract creation system for law firms

COPLEX: real-time logistics optimization

Watson: cognitive system that defeated former human champions in the Jeopardy! quiz show

SecuritEase: the dominant stock broking system in New Zealand

Hivatkozások

KAPCSOLÓDÓ DOKUMENTUMOK

1) I provide a model for the syntactic behaviour and semantic characteristics of FCIs in Hungarian with very good empirical coverage, based on standard assumptions about the syntax

Such metalogical argument could be used also to deduce non-atomicity of finitely generated free algebras of other important classes of algebras of logics, e.g.,, representable

This ES developed by logical programming language 'PROLOG' helps to get information from, or give solution(s) to an observed pollution what needs urgent localization or

Keywords: heat conduction, second sound phenomenon,

A consistent theory is known to define all equiyalence relation (relative logical equivalence with respect to this theory) Oil the set of formulae of the language:

While there are many good examples for such environments for the younger genera- tion, which involve block-based programming, gamified learning, appropriate language of the tasks

In this section we present how it is possible to introduce the resources of space and time into LL. Our approach follows the famous idea published in [9] and it represents a

If we consider the vertical fragments in Figure 1, we can construct various modal extensions of linear logic that enable additional useful applications in