• Keine Ergebnisse gefunden

A3. Transition Systems and Propositional Logic

N/A
N/A
Protected

Academic year: 2022

Aktie "A3. Transition Systems and Propositional Logic"

Copied!
7
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

Planning and Optimization

A3. Transition Systems and Propositional Logic

Gabriele R¨ oger and Thomas Keller

Universit¨ at Basel

October 1, 2018

G. R¨oger, T. Keller (Universit¨at Basel) Planning and Optimization October 1, 2018 1 / 27

Planning and Optimization

October 1, 2018 — A3. Transition Systems and Propositional Logic

A3.1 Transition Systems A3.2 Example: Blocks World

A3.3 Reminder: Propositional Logic A3.4 Summary

G. R¨oger, T. Keller (Universit¨at Basel) Planning and Optimization October 1, 2018 2 / 27

Content of this Course

Planning

Classical

Tasks Progression/

Regression Complexity Heuristics

Probabilistic

MDPs Uninformed Search

Heuristic Search Monte-Carlo

Methods

G. R¨oger, T. Keller (Universit¨at Basel) Planning and Optimization October 1, 2018 3 / 27

Goals for Today

Today:

I introduce a mathematical model for planning tasks:

transition systems Chapter A3

I introduce compact representations for planning tasks suitable as input for planning algorithms

Chapter A4

G. R¨oger, T. Keller (Universit¨at Basel) Planning and Optimization October 1, 2018 4 / 27

(2)

A3. Transition Systems and Propositional Logic Transition Systems

A3.1 Transition Systems

G. R¨oger, T. Keller (Universit¨at Basel) Planning and Optimization October 1, 2018 5 / 27

A3. Transition Systems and Propositional Logic Transition Systems

Transition System Example

Transition systems are often depicted as directed arc-labeled graphs with decorations to indicate the initial state and goal states.

`

1

`

1

`

1

`

1

`

3

`

3

`

2

`

4

`

3

`

4

`

4

`

4

`

2

`

2

c(`

1

) = 1, c(`

2

) = 1, c (`

3

) = 5, c(`

4

) = 0

G. R¨oger, T. Keller (Universit¨at Basel) Planning and Optimization October 1, 2018 6 / 27

A3. Transition Systems and Propositional Logic Transition Systems

Transition Systems

Definition (Transition System)

A transition system is a 6-tuple T = hS , L, c, T , s 0 , S ? i where

I S is a finite set of states,

I L is a finite set of (transition) labels,

I c : L → R + 0 is a label cost function,

I T ⊆ S × L × S is the transition relation,

I s 0 ∈ S is the initial state, and

I S ? ⊆ S is the set of goal states.

We say that T has the transition hs, `, s 0 i if hs , `, s 0 i ∈ T .

A3. Transition Systems and Propositional Logic Transition Systems

Deterministic Transition Systems

Definition (Deterministic Transition System)

A transition system is called deterministic if for all states s

and all labels `, there is at most one state s 0 with s − → ` s 0 .

Example: previously shown transition system

(3)

A3. Transition Systems and Propositional Logic Transition Systems

Transition System Terminology (1)

We use common terminology from graph theory:

I s 0 successor of s if s → s 0

I s predecessor of s 0 if s → s 0

G. R¨oger, T. Keller (Universit¨at Basel) Planning and Optimization October 1, 2018 9 / 27

A3. Transition Systems and Propositional Logic Transition Systems

Transition System Terminology (2)

We use common terminology from graph theory:

I s 0 reachable from s if there exists a sequence of transitions s 0`

1

s 1 , . . . , s n−1`

n

s n s.t. s 0 = s and s n = s 0

I

Note: n = 0 possible; then s = s

0

I

s

0

, . . . , s

n

is called (state) path from s to s

0

I

`

1

, . . . , `

n

is called (label) path from s to s

0

I

s

0

`

1

s

1

, . . . , s

n−1

`

n

s

n

is called trace from s to s

0

I

length of path/trace is n

I

cost of label path/trace is P

n i=1

c(`

i

)

G. R¨oger, T. Keller (Universit¨at Basel) Planning and Optimization October 1, 2018 10 / 27

A3. Transition Systems and Propositional Logic Transition Systems

Transition System Terminology (3)

We use common terminology from graph theory:

I s 0 reachable (without reference state) means reachable from initial state s 0

I solution or goal path from s : path from s to some s 0 ∈ S ?

I

if s is omitted, s = s

0

is implied

I transition system solvable if a goal path from s 0 exists

G. R¨oger, T. Keller (Universit¨at Basel) Planning and Optimization October 1, 2018 11 / 27

A3. Transition Systems and Propositional Logic Example: Blocks World

A3.2 Example: Blocks World

G. R¨oger, T. Keller (Universit¨at Basel) Planning and Optimization October 1, 2018 12 / 27

(4)

A3. Transition Systems and Propositional Logic Example: Blocks World

Running Example: Blocks World

I Throughout the course, we occasionally use the blocks world domain as an example.

I In the blocks world, a number of differently blocks are arranged on a table.

I Our job is to rearrange them according to a given goal.

G. R¨oger, T. Keller (Universit¨at Basel) Planning and Optimization October 1, 2018 13 / 27

A3. Transition Systems and Propositional Logic Example: Blocks World

Blocks World Rules (1)

Location on the table does not matter.

Location on a block does not matter.

G. R¨oger, T. Keller (Universit¨at Basel) Planning and Optimization October 1, 2018 14 / 27

A3. Transition Systems and Propositional Logic Example: Blocks World

Blocks World Rules (2)

At most one block may be below a block.

At most one block may be on top of a block.

A3. Transition Systems and Propositional Logic Example: Blocks World

Blocks World Transition System for Three Blocks

(5)

A3. Transition Systems and Propositional Logic Example: Blocks World

Blocks World Computational Properties

blocks states

1 1

2 3

3 13

4 73

5 501

6 4051

7 37633

8 394353 9 4596553

blocks states

10 58941091

11 824073141

12 12470162233

13 202976401213

14 3535017524403

15 65573803186921 16 1290434218669921 17 26846616451246353 18 588633468315403843

I Finding solutions is possible in linear time

in the number of blocks: move everything onto the table, then construct the goal configuration.

I Finding a shortest solution is NP-complete given a compact description of the problem.

G. R¨oger, T. Keller (Universit¨at Basel) Planning and Optimization October 1, 2018 17 / 27

A3. Transition Systems and Propositional Logic Example: Blocks World

The Need for Compact Descriptions

I We see from the blocks world example that transition systems are often far too large to be directly used as inputs

to planning algorithms.

I We therefore need compact descriptions of transition systems.

I For this purpose, we will use propositional logic, which allows expressing information about 2 n states as logical formulas over n state variables.

G. R¨oger, T. Keller (Universit¨at Basel) Planning and Optimization October 1, 2018 18 / 27

A3. Transition Systems and Propositional Logic Reminder: Propositional Logic

A3.3 Reminder: Propositional Logic

G. R¨oger, T. Keller (Universit¨at Basel) Planning and Optimization October 1, 2018 19 / 27

A3. Transition Systems and Propositional Logic Reminder: Propositional Logic

More on Propositional Logic

Need to Catch Up?

I This section is a reminder. We assume you are already well familiar with propositional logic.

I If this is not the case, we recommend Chapters B1 and B2 of the Theory of Computer Science course at

https://dmi.unibas.ch/de/studium/

computer-science-informatik/fs18/

main-lecture-theory-of-computer-science/

G. R¨oger, T. Keller (Universit¨at Basel) Planning and Optimization October 1, 2018 20 / 27

(6)

A3. Transition Systems and Propositional Logic Reminder: Propositional Logic

Syntax of Propositional Logic

Definition (Logical Formula)

Let A be a set of atomic propositions.

The logical formulas over A are constructed by finite application of the following rules:

I > and ⊥ are logical formulas (truth and falsity).

I For all a ∈ A, a is a logical formula (atom).

I If ϕ is a logical formula, then so is ¬ϕ (negation).

I If ϕ and ψ are logical formulas, then so are (ϕ ∨ ψ) (disjunction) and (ϕ ∧ ψ) (conjunction).

G. R¨oger, T. Keller (Universit¨at Basel) Planning and Optimization October 1, 2018 21 / 27

A3. Transition Systems and Propositional Logic Reminder: Propositional Logic

Syntactical Conventions for Propositional Logic

Abbreviations:

I (ϕ → ψ) is short for (¬ϕ ∨ ψ) (implication)

I (ϕ ↔ ψ) is short for ((ϕ → ψ) ∧ (ψ → ϕ)) (equijunction)

I parentheses omitted when not necessary:

I

(¬) binds more tightly than binary connectives

I

(∧) binds more tightly than (∨), which binds more tightly than (→), which binds more tightly than (↔)

G. R¨oger, T. Keller (Universit¨at Basel) Planning and Optimization October 1, 2018 22 / 27

A3. Transition Systems and Propositional Logic Reminder: Propositional Logic

Semantics of Propositional Logic

Definition (Valuation, Model)

A valuation of propositions A is a function v : A → {T, F}.

Define the notation v | = ϕ (v satisfies ϕ; v is a model of ϕ;

ϕ is true under v ) for valuations v and formulas ϕ by

I v | = >

I v 6| = ⊥

I v | = a iff v (a) = T (for all a ∈ A)

I v | = ¬ϕ iff v 6| = ϕ

I v | = (ϕ ∨ ψ) iff (v | = ϕ or v | = ψ)

A3. Transition Systems and Propositional Logic Reminder: Propositional Logic

Propositional Logic Terminology (1)

I A logical formula ϕ is satisfiable

if there is at least one valuation v such that v | = ϕ.

I Otherwise it is unsatisfiable.

I A logical formula ϕ is valid or a tautology if v | = ϕ for all valuations v .

I A logical formula ψ is a logical consequence of a logical formula ϕ, written ϕ | = ψ, if v | = ψ for all valuations v with v | = ϕ.

I Two logical formulas ϕ and ψ are logically equivalent,

written ϕ ≡ ψ, if ϕ | = ψ and ψ | = ϕ.

(7)

A3. Transition Systems and Propositional Logic Reminder: Propositional Logic

Propositional Logic Terminology (2)

I A logical formula that is a proposition a or a negated

proposition ¬a for some atomic proposition a ∈ A is a literal.

I A formula that is a disjunction of literals is a clause.

This includes unit clauses ` consisting of a single literal and the empty clause ⊥ consisting of zero literals.

I A formula that is a conjunction of literals is a monomial.

This includes unit monomials ` consisting of a single literal and the empty monomial > consisting of zero literals.

Normal forms:

I negation normal form (NNF)

I conjunctive normal form (CNF)

I disjunctive normal form (DNF)

G. R¨oger, T. Keller (Universit¨at Basel) Planning and Optimization October 1, 2018 25 / 27

A3. Transition Systems and Propositional Logic Summary

A3.4 Summary

G. R¨oger, T. Keller (Universit¨at Basel) Planning and Optimization October 1, 2018 26 / 27

A3. Transition Systems and Propositional Logic Summary

Summary

I Transition systems are (typically huge) directed graphs that encode how the state of the world can change.

I Propositional logic allows us to compactly describe complex information about large sets of valuations as logical formulas.

G. R¨oger, T. Keller (Universit¨at Basel) Planning and Optimization October 1, 2018 27 / 27

Referenzen

ÄHNLICHE DOKUMENTE

I Propositional formulas combine atomic formulas with ¬, ∧, ∨, → to more complex statements. I Interpretations determine which atomic formulas are true and which ones

Resolution can be used for general reasoning by reducing to a test for unsatisfiability... Reasoning

Helmert (University of Basel) Foundations of Artificial Intelligence April 26, 2021 2 / 19.. Propositional

31.2 Systematic Search: DPLL 31.3 DPLL on Horn Formulas 31.4 Summary.. Helmert (University of Basel) Foundations of Artificial Intelligence April 26, 2021 2

the number of unsatisfied clauses are possible in Walksat smaller risk of getting stuck in local

propositional logic based on atomic propositions syntax defines what well-formed formulas are semantics defines when a formula is true interpretations are the basis of

Sch¨ oning: Logik f¨ ur Informatiker Picture courtesy of graur razvan ionut / FreeDigitalPhotos.net...

Propositional planning tasks compactly represent transition systems and are suitable as inputs for planning algorithms. They are based on concepts from propositional logic, enhanced