Compact Encoding of FOL - PowerPoint PPT Presentation

1 / 53
About This Presentation
Title:

Compact Encoding of FOL

Description:

Compact Propositional Encoding of. First Order Theories. Eyal Amir ... Hi (p) : pigeon p is not in a hole in the subtree rooted at i. O(n logn) props ... – PowerPoint PPT presentation

Number of Views:50
Avg rating:3.0/5.0
Slides: 54
Provided by: eya9
Category:
Tags: fol | compact | encoding | pigeon

less

Transcript and Presenter's Notes

Title: Compact Encoding of FOL


1
Compact Propositional Encoding ofFirst Order
Theories
  • Eyal Amir
  • University of Illinois at Urbana-Champaign
  • (Joint with Deepak Ramachandran and Igor Gammer)

2
Example Pigeonhole Principle
p1
H1
p2
H2
p3
H3
p4
H4
3
Pigeonhole Classical Encoding
  • H1(pi) ? H2(pi) ? H3(pi) ? H4(pi)
  • ? H1(pi) ? H2(pi)
  • ??p,q (p?q ? Hi(p) ? Hi(q))

Every i
O(n2) props
4
A Reformulation
  • Hi(p) pigeon p is not in a hole in the subtree
    rooted at i.

H1
p1
p3
H3
H2
p4
p2
1
2
3
4
5
A Reformulation
Hi(p) pigeon p is not in a hole in the subtree
rooted at i.
?pH1(p) ?(H2(p)? H3(p))
H1
p1
p3
?pH2(p) ?(-H1(p)? -H2(p))
?pH1(p) ?(-H3(p)?-H4(p))
p4
p2
1
2
3
4
6
A Reformulation
  • Hi(p) pigeon p is not in a hole in the subtree
    rooted at i.

?pH1(p) ? H2(p)
p1
p3
?p?H1(p) ??H2(p)
?p?H3(p)??H4(p)
p4
p2
1
2
3
4
7
A Reformulation
  • Hi(p) pigeon p is not in a hole in the subtree
    rooted at i.

H1
p1
p3
H3
H2
?p,qHi(p)?Hi(q) ?(pq)
p4
p2
8
A Reformulation
  • Hi(p) pigeon p is not in a hole in the subtree
    rooted at i.

?p?H1(p)
p1
p3
H3
H2
O(nlogn) props
p4
p2
9
Propositional Encodings Motivation
  • How do we do this in general? scientific
    curiosity
  • Applications
  • Formal verification, BMC specification in FOL
  • AI planning, diagnosis, spatial reasoning,
    question answering from knowledge specified in
    FOL
  • Useful with many objects, predicates, time steps,
    etc.
  • Can use efficient SAT solvers

10
Outline
  • Algorithm for compact prop. encoding
  • Analysis
  • Interpolants correctness of algorithm
  • A different Treewidth number of props.
  • Towards automatic partitioning
  • Related work open questions

11
Naïve Propositional Encoding
  • Tasks converted into propositional logic
  • P(a) ? Pa ?x P(x) ? Pa ? Pb ? Pc
  • (Naive Propositionalization)
  • Problem Very many propositions
  • PCk for P predicates of arity k,
    and C constant symbols
  • Note Assumes Domain Closure (DCA)
  • constant symbols name all domain objects

12
Our Results
  • New method for propositioal encoding
  • Size depends on optimal tree decomposition (e.g.,
    O(PC) sometimes O(n logn) instead of O(n2)
    for Pigeonhole Principle)
  • Applications
  • Machine scheduling problem
  • Board-Level Routing Problem for FPGAs

13
Our New Algorithm
  • Rough algorithm (given theory T)
  • Partition theory T into T1Tr (1)
  • Encode every Ti in propositional logic Ti
    separately (create proposition Pa for constant a
    and predicate P in L(Ti)) (2)
  • Return UirTi

14
Partitioned Theory
T

15
Partitioned Theory
T1
T2


16
Propositional Encoding
T1
T2


17
Propositional Encoding
T1
T2


18
Propositional Encoding
T1
T2


19
Propositional Encoding
T1
T2


20
Propositional Encoding
T1
T2


21
Propositional Encoding
T1
T2


22
Partitioned Propositional Encoding
  • Algorithm
  • Partition theory T into T1Tr
  • Propositionalize each Ti separately
  • Return the propositional encoding UirTi

PiCi props.
? an exponential speed-up for SAT solver
How to make this soundcomplete?
23
Experiments Board-Level Routing
prop. vars per problem
SAT Running time (sec.) per problem
24
Experiments Machine Scheduling
prop. vars per problem
SAT Running time (sec.) per problem
25
Outline
  • Algorithm for compact prop. encoding
  • Analysis
  • Interpolants correctness of algorithm
  • A different Treewidth number of props.
  • Towards automatic partitioning
  • Related work open questions

26
Key to Exact Encoding
  • Craigs interpolation theorem (First-Order
    Logic)
  • If T1 T2, then there is a formula C including
    only symbols from L(T1) ? L(T2) such that T1 C
    and C T2




T1

T2
P(x)
27
Key to Exact Encoding
  • Craigs interpolation theorem (First-Order
    Logic)
  • If T1 ?T2, then there is a formula C
    including only symbols from L(T1) ? L(T2) such
    that T1 C and C ?T2




T1

?T2
The only interpolants (the Cs) can be
?xP(x),?xP(x), (6 others)
P(x)
28
Key to Exact Encoding
  • Key idea If our prop. encoding of T1 T2
    implies all possible interpolants in L(T1)?L(T2),
    then the combined encoding is SAT iff T (in FOL)
    is SAT.

T1

?T2
The only interpolants (the Cs) can be
?xP(x),?xP(x), (6 others)
P(x)
29
Propositional Encoding
T1
T2


30
Correctness of Encoding Alg.
  • Encoding of each partition needs to include
    encodings of all possible interpolants (detailed
    next)
  • When there are more than two partitions, the
    partitions are arranged in a tree decomposition
    (in next section)

31
Outline
  • Algorithm for compact prop. encoding
  • Analysis
  • Interpolants correctness of algorithm
  • A different Treewidth number of props.
  • Towards automatic partitioning
  • Related work open questions

32
Propositional Encoding Size
T1
T2


33
Propositional encoding of Monadic FOL
Factor single-variable existentially quantified
formula Theorem Can convert any monadic FOL
formula to a conjunction of disjunctions of
factors Example
34
Propositionalizing a Partition in Monadic FOL
  • Convert Ti to factorized form
  • Replace factors in ?i with prop. symbols
  • Add meaning of new propositions

e(Ti)
This approach creates PiCi3Pi
propositional symbols.
35
Outline
  • Algorithm for compact prop. encoding
  • Analysis
  • Interpolants correctness of algorithm
  • A different Treewidth number of props.
  • Towards automatic partitioning
  • Related work open questions

36
Automatic Partitioning and Propositional Encoding
  • Optimization criteria
  • Tree of partitions of axioms that satisfies the
    running intersection property
  • Minimize PiCi3Pi (contrast with
    treewidth, where we minimize Pi)
  • Can use current algorithms for treewidth and
    decomposition as a starting point
  • Sometime need reformulation of axioms

37
Automatic Partitioning
  • Find a tree decomposition G of minimum width
  • Every node in G is a set of symbols from T
  • G satisfies the running intersection property if
    P appears in both v,u in G, then P appears in all
    the nodes on the path connecting them
  • Choose G with minimum width (width(G) is the size
    of its largest node v)

38
Outline
  • Algorithm for compact prop. encoding
  • Analysis
  • Interpolants correctness of algorithm
  • A different Treewidth number of props.
  • Towards automatic partitioning
  • Related work open questions

39
Related Work
  • McMillan 2005 some ground (QF) FOL theories
    have ground interpolants
  • May use his results for similar results on
    compact prop. for those theories
  • McMillans talk yesterday may use our compact
    prop. method to generate all interpolants

40
Related Work
  • Pnueli, Rodeh, Strichman, Siegel 99, 02
    equational theories (no predicates), and
    weak(er?) bound
  • where R resulting universe size, and others
    are problem dependent (worst case n!, for n
    variables/constants)

41
Conclusion
  • Created efficient propositional encodings
  • Monadic FOL Sound Complete
  • Ramsey class Sound, Incomplete without DCA
  • Applies to general FOL (with DCA)
  • Speedup in SAT solving
  • Exploits the structure of real world problems
  • Future work Classes beyond Monadic FOL
  • Right now ground FOL with equality
  • 2-var fragment
  • Some software on http//reason.cs.uiuc.edu/eyal

42
THE END
43
Problems with Naïve Prop.
  • Problem 1 Very large number of propositions
  • PCk for P predicates of arity k,
    and C constant symbols
  • Problem 2 Assumes Domain Closure Assumption
    (DCA) only elements are those with constant
    symbols

44
General FOL (with DCA)
  • Use DCA repeatedly until we get a formula in
    Monadic FOL
  • Replace ?x1Qx2Qxn?(x1,, xn) with
  • ?c?C Qx2Qxn?(x1,, xn)
  • Replace ?x1Qx2Qxn?(x1,, xn) with
  • ?c?C Qx2Qxn?(x1,, xn)

45
Automatic Partitioning
  • Begin with logical Knowledge Base in FOL
  • Construct symbol graph
  • vertex symbol
  • edge axiom uses both symbols
  • Find a tree decomposition
  • Partition axioms using clusters in tree
    decomposition

46
Automatic Partitioning
key ? ?locked ? can_open can_open Ù
try_open ? open open Ù fetch ?
broom key ? open try_open ? open ? broom ? fetch
broom Ù dry ? can_clean can_clean ?
clean broom Ù let_dry ? dry time ?
let_dry drier ? let_dry time ? drier
47
Automatic Partitioning
key ? ?locked ? can_open can_open Ù
try_open ? open open Ù fetch ?
broom key ? open try_open ? open ? broom ? fetch
broom Ù dry ? can_clean can_clean ?
clean broom Ù let_dry ? dry time ?
let_dry drier ? let_dry time ? drier
48
Automatic Partitioning
key ? ?locked ? can_open can_open Ù
try_open ? open open Ù fetch ?
broom key ? open try_open ? open ? broom ? fetch
broom Ù dry ? can_clean can_clean ?
clean broom Ù let_dry ? dry time ?
let_dry drier ? let_dry time ? drier
49
Automatic Partitioning
key
locked
can_open
try_open
clean
can_clean
open
fetch
dry
time
broom
let_dry
drier
50
Automatic Partitioning
key
locked
can_open
try_open
clean
can_clean
open
fetch
dry
time
broom
let_dry
drier
51
Automatic Partitioning
broom
key
locked
can_open
try_open
clean
can_clean
open
fetch
dry
time
broom
let_dry
drier
52
Automatic Partitioning
broom
key
locked
can_open
try_open
clean
can_clean
broom
open
fetch
dry
time
broom
let_dry
drier
53
Automatic Partitioning
key ? ?locked ? can_open can_open Ù
try_open ? open open Ù fetch ?
broom key ? open try_open ? open ? broom ? fetch
broom Ù dry ? can_clean can_clean ?
clean broom Ù let_dry ? dry time ?
let_dry drier ? let_dry time ? drier
broom
Write a Comment
User Comments (0)
About PowerShow.com