Presentation is loading. Please wait.

Presentation is loading. Please wait.

Winter 2004/5Pls – inductive – Catriel Beeri1 Inductive Definitions (our meta-language for specifications)  Examples  Syntax  Semantics  Proof Trees.

Similar presentations


Presentation on theme: "Winter 2004/5Pls – inductive – Catriel Beeri1 Inductive Definitions (our meta-language for specifications)  Examples  Syntax  Semantics  Proof Trees."— Presentation transcript:

1 Winter 2004/5Pls – inductive – Catriel Beeri1 Inductive Definitions (our meta-language for specifications)  Examples  Syntax  Semantics  Proof Trees  Rule set as a function  Proof by induction  Function ( & relation) definition by induction  Generalizing rule form

2 Winter 2004/5Pls – inductive – Catriel Beeri2 An inductive definition by one axiom, one proper rule  Examples

3 Winter 2004/5Pls – inductive – Catriel Beeri3 Questions: 1.Do we know which elements are in S? (at least, can we enumerate them?) 2. Given c, can we answer :is c a member of S? 3. Which is the underlying universe here ? A: any of N, Z, Q, …. It is common to omit the universe, U, since: –It is often known from the context –The rules “tell” us what it is –Even if there are several candidates, the defined set is often the same in them

4 Winter 2004/5Pls – inductive – Catriel Beeri4 4. Is there just one set in N that satisfies (r1), (r2)? If not, which one is the one being defined? A: The intention is the least set that satisfies the rules But, “least’ is often omitted Note difference between minimal, least (in a collection) * There is an abuse of language. It should be Easier to use S for both: defined and a set variable

5 Winter 2004/5Pls – inductive – Catriel Beeri5 Can we enumerate? Solve membership? Is the defined set independent of the universe?

6 Winter 2004/5Pls – inductive – Catriel Beeri6 A new problem: goal resolution Given c, can we find all y s.t. S(c,y)? c – a goal (on 1 st position) y, such that S(c,y) – a solution Can we solve when the goal is on 2 nd position?

7 Winter 2004/5Pls – inductive – Catriel Beeri7 Q: is the defined set independent of universe? What about goal resolution on either column?

8 Winter 2004/5Pls – inductive – Catriel Beeri8 Inductive definition: a set R of rules A rule: conjunction of premises (הנחות) implies conclusion or: body implies head Our style: (no commas!)  Syntax

9 Winter 2004/5Pls – inductive – Catriel Beeri9 Empty body (0 premises) – an axiom: Otherwise, a proper rule 1 st Example: Here, x, y are individual variables

10 Winter 2004/5Pls – inductive – Catriel Beeri10  Semantics Variable assignment : maps individual variables to constants (in U) Applied to a rule  a ground (var-free) rule instance S satisfies rule r if for each r-instance, if body is true in S then head is true in S (Individual vars are universally quantified) S satisfies R, if it satisfies each r in R

11 Winter 2004/5Pls – inductive – Catriel Beeri11 If U (the universe) –contains the constants in R, –is closed under the operations in R, then it satisfies R – satisfying set exists Intersection property : If each set satisfies R, so does Hence, a (unique) least set that satisfies R exists This set is the semantics of R – ind{R}

12 Winter 2004/5Pls – inductive – Catriel Beeri12 Extensions Define several sets simultaneously –Can use in rules, for each defined Can assume certain sets are given (known) – Can use in premises (This is not a real extension, can use these in conditions) These enable construction of definition hierarchies.

13 Winter 2004/5Pls – inductive – Catriel Beeri13 Example of a proof of membership in an inductive set: Each leaf – an axiom instance Each internal node – inferred from its children – a rule instance  Proof Trees

14 Winter 2004/5Pls – inductive – Catriel Beeri14 We abbreviate to : Element a is inferred from by rule r if... Q: What when r is an axiom?

15 Winter 2004/5Pls – inductive – Catriel Beeri15 Proof Tree A tree in which each node is labeled by a is the element at the node Associated with a rule r such that: is inferred from the children of the node by r (for a leaf --- associated rule is an axiom) (Labels of a node & its children ~ rule instance) Proof trees contain only membership formulas Proof tree – a composition of inferences

16 Winter 2004/5Pls – inductive – Catriel Beeri16 Fact: a is in ind{R} iff it has a proof tree Proof tree is a proof of membership for its root How do we prove this? 1.An arbitrary satisfying set contains every element that has a proof tree --- induction on depth of tree 2.The set of elements that have proof trees is a satisfying set

17 Winter 2004/5Pls – inductive – Catriel Beeri17  Rule set as a function Generalize: For example 1: Fact: closed under r/R = satisfies r/R Fact: (same for )

18 Winter 2004/5Pls – inductive – Catriel Beeri18 Define: Q is closed under r/R if it is closed under : Fact: closed under r/R = satisfies r/R Fact: same for

19 Winter 2004/5Pls – inductive – Catriel Beeri19 Thm: [Knaster-Tarski, 1955] A monotone function f on sets has the intersection property for its closed sets:  if some set is closed under f, a least closed set exists  for any R, a least set closed under R exists (for a large enough universe) (remember: closed under = satisfies)

20 Winter 2004/5Pls – inductive – Catriel Beeri20 Prove for each axiom that P(e) holds Prove for each rule that if (and ) then P(e) holds (actually, prove it for each variable assignment) proof by rule induction Example: prove for Example 1 that each element in S is divisible by 4  Proof by induction

21 Winter 2004/5Pls – inductive – Catriel Beeri21  Function ( & relation) definition by induction For each axiom, define f(e) For each rule define f(e) in terms of Example: fact(0) = 1 fact(n+1) = (n+1)*fact(n) Why is it called definition by induction? Hint: What is the domain, and the rules that define it? and what is the form of the function definition

22 Winter 2004/5Pls – inductive – Catriel Beeri22 Let rfact be the graph of fact, a binary relation. Compare: To fact(0) = 1 fact(n+1) = (n+1)*fact(n) “Inductive” has a double meaning – the domain is inductively defined –The function is inductively defined (in a special syntax) and the two rules sets correspond

23 Winter 2004/5Pls – inductive – Catriel Beeri23 Function def. by induction: function defined by clauses, one for each rule defining the domain Significance : One-to-one correspondence  fact is total Sometimes, we need a partial function; we provide clauses for only some of the rules that define the domain Example: head and tail on lists

24 Winter 2004/5Pls – inductive – Catriel Beeri24 Consider: Define We have: What went wrong? (think of proof trees) “Function” is total, but ill-defined!

25 Winter 2004/5Pls – inductive – Catriel Beeri25 Function & relation definitions, summary Over an inductively defined domain Inductive definition of relation is always ok. Inductive function definition –Is always total –may fail to be well-defined a sufficient condition for well-defined-ness: each value of domain has a unique proof tree

26 Winter 2004/5Pls – inductive – Catriel Beeri26  Generalizing rule form It is allowed to combine membership formulas by Conjunction in head Disjunction in body But, Disjunction in head, negation in body/head are forbidden Why? As for quantifiers --- see reading material


Download ppt "Winter 2004/5Pls – inductive – Catriel Beeri1 Inductive Definitions (our meta-language for specifications)  Examples  Syntax  Semantics  Proof Trees."

Similar presentations


Ads by Google