Modular Proof Systems for Partial Functions with Weak Equality - - PowerPoint PPT Presentation

modular proof systems for partial functions with weak
SMART_READER_LITE
LIVE PREVIEW

Modular Proof Systems for Partial Functions with Weak Equality - - PowerPoint PPT Presentation

Modular Proof Systems for Partial Functions with Weak Equality Harald Ganzinger Viorica Sofronie-Stokkermans Uwe Waldmann 1 Three (Unrelated?) Topics Topic 1: Hierarchic extensions of theories. Let 0 be a signature, let T 0 be a 0


slide-1
SLIDE 1

Modular Proof Systems for Partial Functions with Weak Equality

Harald Ganzinger † Viorica Sofronie-Stokkermans Uwe Waldmann

1

slide-2
SLIDE 2

Three (Unrelated?) Topics

Topic 1: Hierarchic extensions of theories. Let Σ0 be a signature, let T0 be a Σ0-theory. Let Σ1 be an extension of Σ0. Can one use a prover for T0 as a black-box to prove theorems

  • ver Σ1 relative to T0?

Example: T0 = natural numbers with ordering; Σ1 = {read, write}; Task: prove some property of sorted arrays.

2

slide-3
SLIDE 3

Three (Unrelated?) Topics

Topic 2: Modularity. Let Σ1 ∩ Σ2 = Σ0 = ∅. Can one get a complete prover for Σ1 ∪ Σ2 by combining provers for Σ1 and Σ2? Problem: The provers can only communicate using formulas

  • ver Σ0. Is that sufficient?

Example: Σ0 = some data; Σ1 = lists over data; Σ2 = arrays over data.

3

slide-4
SLIDE 4

Three (Unrelated?) Topics

Topic 3: Partial functions. Many partial functions occur in practical problems: car, cdr, pop, division, array access, . . . How can one deal in a sound and efficient way with partial functions in a theorem prover?

4

slide-5
SLIDE 5

Three (Related!) Topics

What is the relationship? Partial functions allow to prove better results for modularity and hierarchic combinations: If function symbols in T1 \ T0 are partial, then hierarchic proving is possible. If function symbols in T1 \ T2 and T2 \ T1 are partial, then combining provers for T1 and T2 is possible (it is sufficient if they communicate using formulas

  • ver T1 ∩ T2).

5

slide-6
SLIDE 6

Logic for Partial Functions

Many possible approaches (usually discussed for the purely equational case): existential equality strong equality Evans equality . . . Central question: Does an equation s ≈ t imply that s and t are defined?

6

slide-7
SLIDE 7

Logic for Partial Functions

Here: Evans equality g(t1, . . . , tn) ≈ s means: if s is defined, and if t1, . . . , tn are defined, then g(t1, . . . , tn) is defined and equal to s. Note: ti undefined ⇒ result is irrelevant ⇒ equation holds vacuously. Example: The formulas ∀x. ∀y. car(cons(x, y)) ≈ x ∀x. cons(car(x), cdr(x)) ≈ x hold in the standard partial model.

7

slide-8
SLIDE 8

Logic for Partial Functions

How can we extend Evans equality to arbitrary formulas? An equation is true if one of its terms is irrelevant, that is, if some proper subterm is undefined.

8

slide-9
SLIDE 9

Logic for Partial Functions

How can we extend Evans equality to arbitrary formulas? An equation is true if one of its terms is irrelevant, that is, if some proper subterm is undefined. Our approach: the same property holds also for negated equations and arbitrary clauses!

9

slide-10
SLIDE 10

Logic for Partial Functions v1 v2 un ir v1 = / = / = ? v2 / = = / = ? un / = / = ? ? ir ? ? ? ?

10

slide-11
SLIDE 11

Logic for Partial Functions v1 v2 un ir v1 = / = / = ? v2 / = = / = ? un / = / = ? ? ir ? ? ? ?

11

slide-12
SLIDE 12

Logic for Partial Functions v1 v2 un ir v1 = / = / = ? v2 / = = / = ? un / = / = ? ? ir ? ? ? ?

12

slide-13
SLIDE 13

Logic for Partial Functions v1 v2 un ir v1 = / = / = ? v2 / = = / = ? un / = / = ? ? ir ? ? ? ?

Example: The formulas car(nil) ≈ cdr(nil) car(nil) ≈ cdr(nil) car(car(nil)) ≈ nil car(car(nil)) ≈ nil hold in the standard partial model.

13

slide-14
SLIDE 14

Logic for Partial Functions v1 v2 un ir v1 = / = / = ? v2 / = = / = ? un / = / = ? ? ir ? ? ? ?

Formally: Three-valued logic {0, 1

2, 1},

x ∧ y = min{x, y}, x ∨ y = max{x, y}, ¬x = 1 − x, A | = F iff A(F) ≥ 1

2.

14

slide-15
SLIDE 15

Logic for Partial Functions

Expressivity: We can express that a term t is not defined: t ≈ t. If a function symbol is declared as partial, then we can express that it is defined for certain arguments, but only by giving a definition: ∀x. ∀y. car(cons(x, y)) ≈ x

15

slide-16
SLIDE 16

Partial Superposition

Superposition: Saturation-based calculus for equational clauses (“resolution with built-in equality”) Parameterized by a well-founded term ordering: Inferences must involve maximal terms of clauses. Redundancy ❀ deletion/simplification. Here: terms consisting only of total symbols must be small.

16

slide-17
SLIDE 17

Partial Superposition

Equality resolution: C ∨ s ≈ s′ Cσ if σ is an mgu of s and s′ and s and s′ do not contain partial symbols.

17

slide-18
SLIDE 18

Partial Superposition

Equality resolution: C ∨ s ≈ s′ Cσ if σ is an mgu of s and s′ and s and s′ do not contain partial symbols. Note: LIST | = car(nil) ≈ car(nil) Deleting disequations between undefined or irrelevant terms would be unsound!

18

slide-19
SLIDE 19

Partial Superposition

Superposition: D ∨ t ≈ t′ C ∨ s[u] ≈ s′ (D ∨ C ∨ s[t′] ≈ s′)σ if σ is an mgu of t and u, t has no partial symbols below the top, and xσ does not contain partial symbols.

19

slide-20
SLIDE 20

Partial Superposition

Superposition: D ∨ t ≈ t′ C ∨ s[u] ≈ s′ (D ∨ C ∨ s[t′] ≈ s′)σ if σ is an mgu of t and u, t has no partial symbols below the top, and xσ does not contain partial symbols. Note: LIST | = car(car(nil)) ≈ 1, LIST | = car(car(nil)) ≈ 2 Replacing irrelevant terms would be unsound!

20

slide-21
SLIDE 21

Modularity of Partial Superposition

Easy consequence: Let Σ1 and Σ2 be signatures such that all symbols not in Σ1 ∩ Σ2 are partial. Suppose that all initially given clauses are pure Σ1-clauses or pure Σ2-clauses. Then all inferences are pure. In other words: The Σ1-part and the Σ2-part remain separated except for (Σ1 ∩ Σ2)-clauses that have to be transferred.

21

slide-22
SLIDE 22

Hierarchic Partial Superposition

We can transform partial superposition into a hierarchic calculus: Replace unification by lazy unification: Rather than computing the unifier of two terms f (s, s′) and g(t, t′), we check only that the top symbols are the same and transform the remaining unification problem into new literals. Do not perform any regular inferences on clauses that do not contain partial symbols. Instead: We check whether all such clauses are T0-satisfiable.

22

slide-23
SLIDE 23

Hierarchic Partial Superposition

  • Hier. Superposition:

D ∨ f ( v) ≈ t′ C ∨ s[f ( u)] ≈ s′ D ∨ C ∨ v ≈ u ∨ s[t′] ≈ s′ if f is a partial symbol, and

  • u and

v do not contain partial symbols. Constraint Refutation: M ⊥ if M is a finite set of Σ0-clauses that is inconsistent with the base theory T0.

23

slide-24
SLIDE 24

Hierarchic Partial Superposition

Result: Hierarchic proof system. Σ0-reasoning: by external T0-prover. (Σ1 \ Σ0)-reasoning: by hierarchic partial superposition.

24

slide-25
SLIDE 25

Partial vs. Total Algebras

Partial functions ❀ strong modularity and combination results. To what extent can they be transferred to total functions? Many-sorted logic: extension functions having a result of base sort must be partial; extension functions having a result of extensiom sort may be total. In general: every total model is a partial model, therefore: sound approximation of total logic.

25

slide-26
SLIDE 26

Partial vs. Total Algebras

Shallow extensions: If partial symbols occur only positively and only at the root, then every partial algebra model can be extended to total algebra model. Note: Every set of ground clauses can be transformed into a set of shallow ground clauses (by introducing new (total) constants). Other examples: local theories.

26

slide-27
SLIDE 27

Conclusions

Summary: Logic for partial functions (generalizing Evans equality). Superposition calculus for partial functions (sound and refutationally complete). Partial functions ❀ Modularity results. Hierarchic superposition for partial functions (sound and refutationally complete). Partial functions ❀ Hierarchic combinations. Special cases: sorted logic, shallow theories, . . .

27