Deciding the First-Order Theory of an Algebra of Feature Trees with - - PowerPoint PPT Presentation

deciding the first order theory of an algebra of feature
SMART_READER_LITE
LIVE PREVIEW

Deciding the First-Order Theory of an Algebra of Feature Trees with - - PowerPoint PPT Presentation

Deciding the First-Order Theory of an Algebra of Feature Trees with Updates Nicolas Jeannerod Ralf Treinen IJCAR18 July 16, 2018 1/20 Features Trees Unranked unordered trees. d d g f g f i i h d d d d d d d g f


slide-1
SLIDE 1

1/20

Deciding the First-Order Theory

  • f an Algebra of Feature Trees with Updates

Nicolas Jeannerod Ralf Treinen IJCAR’18 – July 16, 2018

slide-2
SLIDE 2

2/20

Features Trees

⊲ Unranked unordered trees. d f d g d i d d f d g d h d i d f d g d i d ⊲ Least fixpoint of: FT = D ×

  • F FT
  • Decorations

(left abstract) Infinite set

  • f features

Partial function with finite domain

slide-3
SLIDE 3

3/20

Origin of Feature Trees

⊲ Computational linguistics

[eg. Smolka, ’92]

⊲ Artificial intelligence

[A¨ ıt-Kaci]

⊲ (Constraint) (logic) programming

[A¨ ıt-Kaci, Backofen, Podelski, Smolka, Treinen, ’94]

slide-4
SLIDE 4

4/20

Our Use Case – The Unix Filesystem

/ usr lib share etc home jack

slide-5
SLIDE 5

5/20

First Order Logics of Feature Trees

Equality

FT , ρ | = x . = y

iff

ρ(x) = ρ(y)

Feature

FT , ρ | = x[f]y

iff

ρ(x)(f) = ρ(y)

Absence

FT , ρ | = x[f] ↑

iff

f / ∈ dom(ρ(x))

Fence

FT , ρ | = x[F]

iff

dom(ρ(x)) ⊂ F

Model of all the feature trees Variables ranging

  • ver feature trees

Tree associated with y in ρ Valuation from variables to feature trees Feature constant Finite set of feature constants FT CFT

slide-6
SLIDE 6

6/20

Known Decidability of First Order Logics

⊲ FT: x . = y x[f]y x[f] ↑

[Backofen, Smolka, ’92]

⊲ CFT: x . = y x[f]y x[f] ↑ x[F]

[Backofen, ’94] [Backofen, Treinen, ’94]

⊲ FT with first-class features proven undecidable

[Treinen, ’93]

slide-7
SLIDE 7

7/20

Why We Need More

mkdir /home/jack

  • home

× jack

  • home
  • jack

∅ C(r, r′) = ∃x, x′, y′      r[home]x ∧ x[jack] ↑ ∧ r′[home]x′ ∧ x′[jack]y′ ∧ y′[∅] ∧ r′ is r with home → x′ ∧ x′ is x with jack → y′

slide-8
SLIDE 8

8/20

How To Reason About Update Constraints?

⊲ Problem: It is completely asymmetric. y is x with f → v

Resulting tree Source tree Subtree

⊲ Hard to simplify when we have several of them: ∃x ·

  • y is x with f → v

∧z is x with g → w

slide-9
SLIDE 9

9/20

Equivalent Presentation – The Similarity

FT , ρ | = x ∼F y

iff

ρ(x)|cF = ρ(y)|cF

Finite set of feature constants

⊲ Same expressivity: y is x with f → z ↔ y ∼{f} x ∧ y[f]z x ∼{f} y ↔ ∃z, v ·

  • z is x with f → v

∧z is y with f → v

  • ⊲ Convenient to manipulate:

⊲ Equivalence relation for every F . ⊲ But also: x ∼F y ∧ y ∼G z → x ∼F ∪G z x ∼F y ∧ x ∼G y ↔ x ∼F ∩G y

⊲ Similar technique found in arrays.

[Stump, Barrett, Dill, Levitt, 2001]

slide-10
SLIDE 10

10/20

Our Contribution

Theorem

The first order theory of feature trees with update is decidable.

slide-11
SLIDE 11

11/20

First Step: Existential Fragment

∃x, z·

  • y[f]x ∧ ¬(x ∼{h,i} y) ∧ · · ·
  • Existential

quantification

  • n the outside

Positive and negative literals Conjunctive clause

slide-12
SLIDE 12

12/20

Principle of the Algorithm

⊲ We have a set of transformation rules l ⇒ r. ⊲ function

normalize(c: clause ): while some rule r applies to c: c = apply r to c return c

⊲ The rules are equivalences in our model. ⊲ The system terminates. ⊲ Irreducible forms have nice properties.

⊲ eg. they are either ⊥ or satisfiable.

slide-13
SLIDE 13

13/20

Examples of Rules

Simplification: features

∃X, z ·

  • x[f]y ∧ x[f]z ∧ c

∃X ·

  • x[f]y ∧ c{z → y}
  • Clash: feature with absence

x[f]y ∧ x[f] ↑ ∧c ⇒ ⊥

Propagation: feature

(f / ∈F)

x ∼F y ∧ x[f]z ∧ c ⇒ x ∼F y ∧ x[f]z ∧ y[f]z ∧ c

Associative commutative conjunction Equivalences in our model Replacement

  • f z by y in c

Quantifications (omitted when irrelevant) (Not shown) side-conditions for termination

slide-14
SLIDE 14

14/20

Satisfiability of Irreducible Clauses

Theorem

Every irreducible clause that is not ⊥ is satisfiable.

⊲ We need something stronger: Lemma (Garbage collection) ∃X · (g ∧ l) ⊲ irreducible, ⊲ such that there is no y[f]x with y / ∈ X and x ∈ X.

Then

FT | = (∃X · (g ∧ l)) ↔ g

Literals that do not talk about X Literals that mention at least one variable of X

slide-15
SLIDE 15

15/20

First Order

∀ ∃ ∧ ∨ ¬

slide-16
SLIDE 16

16/20

Quantifier Elimination

⊲ Problem: our theory does not have the quantifier elimination property ⊲ What is the meaning for y of: ∃x · (y[f]x ∧ x[g] ↑) ⊲ Two possible solutions:

⊲ Make the language richer

[Presburger, ’29] ⊲ with path constraints: y[f][g] ↑ ⊲ potentially leads to complex simplification rules.

⊲ Weak Quantifier Elimination

[Malc’ev, ’71] ⊲ with a procedure: ∃Y · c ⇒ ∀Z · d ⊲ we can eliminate all the quantifier blocks except one.

slide-17
SLIDE 17

17/20

Switching Quantifiers

⊲ With the lemma and an extra rule [Treinen, ’97]. ∃x, z · (y[f]x ∧ x ∼{h} z ∧ z[g] ↑ ) ∃x, z · (y[f]x ∧ x ∼{h} z ∧ x[g] ↑ ∧ z[g] ↑ ) ∃x · ( y[f]x ∧ x[g] ↑) ¬y[f] ↑ ∧ ∀x · (y[f]x → x[g] ↑) ⊲ We can turn all ∃ into ∀ which allows us to go for Weak Quantifier Elimination.

Apply the system Apply the lemma Switch remaining

∃ to ∀

z[g] ↑ can

propagate through

x ∼{h} z

There is no u and

i such that u[i]z:

remove z There can be

  • nly one such x
slide-18
SLIDE 18

18/20

Weak Quantifier Elimination [Malc’ev, ’71]

⊲ With a procedure: ∃Y · c ⇒ ∀Z · d ∀ · · · ∀ · ∃ · · · ∃ · · · ∀X · ∃Y · d ∀ · · · ∀ · ∃ · · · ∃ · · · ∀X · ∃Y ·

  • i ci
  • ∀ · · · ∀ · ∃ · · · ∃ · · · ∀X ·
  • i ∃Y · ci
  • ∀ · · · ∀ · ∃ · · · ∃ · · · ∀X ·
  • i ∀Zi · di
  • ∀ · · · ∀ · ∃ · · · ∃ · · · ∀ (X ∪

i Z′ i) · ( i d′ i)

Quantifier-free Quantifier-free conjunction

⊲ Eliminate one quantifier alternation at a time.

Disjunctive normal form Distribute

∃ over ∨

Apply procedure Prenex normal form with renaming

slide-19
SLIDE 19

19/20

Full Procedure

Closed formula

PNF + DNF + ... Apply a rule on the innermost part

Reducible formula

Eliminate and switch existential quantifiers

Irreducible formula Formula with quantifiers Quantifier-free formula

Must be closed. Otherwise, the formula is not quantifier-free.

slide-20
SLIDE 20

20/20

Conclusion

⊲ Contribution:

⊲ Feature tree with update. ⊲ Decidability of first order theory.

Theorem

The first order theory of feature trees with update is decidable.

⊲ Procedure parametrized by a theory of node decorations. ⊲ Complexity: non-elementary lower bound.

[Vorobyov, ’96]

⊲ Perspectives:

⊲ Implementation. ⊲ Efficient implementation of a smaller fragment. ⊲ Symbolic execution of Shell scripts. ⊲ “Correctness of Linux Scripts” (http://colis.irif.fr).