Presentation is loading. Please wait.

Presentation is loading. Please wait.

Completeness and Expressiveness. תזכורת למערכת ההוכחה של לוגיקה מסדר ראשון : אקסיומות 1. ) ) (( 2. )) ) (( )) ( ) ((( 3. ))) F( F( ( 4. ) v) ( ) v ((

Similar presentations


Presentation on theme: "Completeness and Expressiveness. תזכורת למערכת ההוכחה של לוגיקה מסדר ראשון : אקסיומות 1. ) ) (( 2. )) ) (( )) ( ) ((( 3. ))) F( F( ( 4. ) v) ( ) v (("— Presentation transcript:

1 Completeness and Expressiveness

2 תזכורת למערכת ההוכחה של לוגיקה מסדר ראשון : אקסיומות 1. ) ) (( 2. )) ) (( )) ( ) ((( 3. ))) F( F( ( 4. ) v) ( ) v (( v אינו חופשי ב - כאשר 5. v (v) (t) כאשר אין משתנה ב t- אשר מופיע קשור ב -.

3 אקסיומות נוספות עבור שוויון. נחזק אותן עבור הוכחה יותר קלה... 6 t t=t 7 (t 1 =t 2 ) ( (t 1 ) (t 2 )) כאשר (t 2 ) ו - (t 1 ) מתקבלות מנוסחא משותפת (v) על ידי החלפת ( חלק מ ) המקומות החופשיים של v ב t 1 או t 2 בהתאמה, כאשר אף משתנה ב t 1 או t 2 לא נקשר לכמת ב -.

4 כללי הוכחה MP (Modus Ponens) GEN (Generalization) (v) x (x) כאשר v אינו מופיע חופשי באף אחת מההנחות

5 Goal: we want to prove Our first order logic proof system is sound and complete. That is: |-- if and only if |== Soundness: |-- implies |== Check that the axioms are tautologies. Check that the proof rules preserves truth. Then, by induction on length of proof any model and assignment that satisfy, satisfies any line in a proof, in particult the last one.

6 Consistency: a syntactic definition, related to the proof system. A set of formulas is consistent if there is no formula such that |-- and |--( F). Equivalent definition: |-/-F. Equivalently: is inconsistent if for each, |--.

7 Lemma |-- iff {( F)} is inconsistent. Proof: if {( F)} is inconsistent then {( F)} |--. Also, { } |--.(why?) Therefore, by proof by cases, |--. Conversely, if |-- then from {( F)} we can prove F (using MP), thus {( F)} is inconsistent. Consequence: |-/- iff {( F)} consistent.

8 More connections If is consistent then either {( F)} or { } is consistent. Proof: if both are inconsistent, then we can prove from {( F)} and from { }. Hence, we can prove using proof by cases from. Contradiction. is consistent iff every subset of it is consistent.

9 More connections |== iff {( F)} is unsatisfiable (why?) If is satifiable then either {( F)} or { } is satisfiable.

10 is consistent is satisfiable. Easy direction: If is inconsistent, given the soundness of the proof system, its is unsatisfiable. (why?) Converseley: From consistent we f om maximal consisten as follows (hard proof).

11 is consistent is satisfiable נראה את המקרה של מספר נוסחאות בר מניה. נסדר את כל הנוסחאות לפי סדר מסויים ( אלפבתי, כמו בספר טלפונים ) 0, 1, 2, …. נבנה סדרה הולכת וגדלה של קבוצות נוסחאות = 0 1 2 …. כדלקמן : אם { i i { קונסיסטנטית אזי { i } i = i+1 אחרת i = i+1. נגדיר *= 0 1 2 …. * היא קונסיסטנטית. כי אם אפשר להוכיח ממנה כל דבר, אפשר להוכיח גם F, ולכן אפשר להוכיח את זה גם מתת קבוצה סופית שלה, בסתירה לבניה.

12 תכונות של * עבור נוסחא כלשהי, לא יתכן שגם וגם ( F) נמצאים שניהם ב - *. הוכחה : אחרת, באיזה שלב, שתי הנוסחאות היו נמצאות, והיינו מקבלים קבוצה לא קונסיסטנטית... עבור נוסחא כלשהי, או או ( F) נמצאים ב -. * הוכחה : נניח כי = k ו -=( F) i אינם נמצאים ב *. אזי F --|{( F) i { וגם F --|{ k { ומכאן לפי " הוכחה לפי מקרים " ומונוטוניות נובע כי F max(i,k) |-- בסתירה לבניה. כלומר, כל נוסחא או השלילה שלה נמצאים ב - * אבל לא שניהם. לכן גם : אם --| אז נמצא ב *.

13 תכונות נוספות של * F אינה נמצאת ב * ( ) נמצא ב - * אם ורק אם או (( F נמצאים ב - *. 1. נניח כי ( ) נמצא ב - *. אם וגם (( F אינם נמצאים ב - * אזי (( F וגם נמצאים ב - *. אבל אז מתקיים {, ( ), ( F) }|--F. סתירה. 2. אם נמצאת ב * אזי גם ( ) נמצאת ב *. הוכחה : שימוש ב - 1A ( )) ) ו -MP. 3. אם ( F) נמצאת ב * אזי גם ( ) נמצאת ב *. הוכחה : נראה ש ( ) |-- * שימוש בדדוקציה מעביר את כהנחה נוספת, יחד עם ( F) ניתן להוכיח כל דבר.

14 Problem If we have in * a formula x (x ), we want to have (t ) * for some term t. In fact x (x ) cannot appear in *. Instead we will have ( x ( (x ) F) F) Then * is closed under withnesses. This may not hold. So well add for each such formula a new variable y and add (y). [This may extend the set of variables!] We obtain 1 and now perform the * closure on it again to obtain 1 * We obtain like that now 2 * 3 *... We take # = i * What we proved before holds also for #

15 Show that is # consistent. Suppose, by contradiction that when we add (y) to the current set P we obtain an inconsistent set. Thus, P { (y)} |-- F. From deduction we obtain P |-- (y ) F From GEN we obtain P |-- y (y) F, which is in contradiction to ( x ( (x ) F) F), which is already in the set of formulas.

16 We now have closed under withnesses x (x ) =( x ( (x ) F) F) is in # iff there is some t such that (t ). Left to right direction, from construction, by adding the new varaible. Right to left direction: Suppose that we have (t ) #. Assume for the contradiction that the negation, x ( (x ) F) is #. Then using A5 we have x ( (x ) F) ( (t) F) and using MP we have ( (t) F), which cannot be consistent with (t ) #.

17 מכאן... קבוצת הנוסחאות # מתנהגת כסמנטיקה של הנוסחאות תחת הצבת אמת. הערך שקבוע c מקבל הוא הסימן c. הערך שמשתנה v מקבל הוא הסימן v. באינדוקציה, הערך שביטוי t מקבל הוא t. יחס R(t 1,t 2,...) מתקיים אם הנוסחא R(t 1,t 2,...) נמצאת ב - #. כל הנוסחאות של נמצאות ב - # כמו במקרה של לוגיקת פסוקים, הטענות הקודמות מראות, באינדוקציה על מבנה הנוסחא שהצבה זאת מתנהגת כהצבה לוגית. לכן, אם קבוצת נוסחאות הינה קונסיסטנטית, יש לה מודל ( מבנה והצבה שמספקים אותה ).

18 Continuing... Suppose now we also have equivalence. What happens when we have t 1 =t 2 ? We take as an interpretation of a constant c all the equivalence class of all the terms t such that c=t holds. We denote this by [c] (or, [t]). Using the axioms A6 and A7 it follows that this definition is consistent, i.e., that if t 1 =t 2 then (t 1 ) is in # iff (t 2 ) is in #

19 Completeness follows We want to prove that |== implies |--. Equivalently: |-/- implies |=/=. |-/- implies that {( F)} is consistent. Therefore, {( F)} is satisfiable. Thus, |=/=.

20 Therefore: Recall: |-- if and only if there is some finite 0 such that 0 |-- (why?) Thus: |== if and only if there is some finite 0 such that 0 |== (why?) This is called Compactness theorem.

21 We can express some classes of structures (why not sets?) 1. xR(x,x) 2. x y(R(x,y) R(y,x)) 3. x y z ((R(x,y)/\R(y,z)) R(x,z)) We can write this using one formula! This defines the structures with R being an equivalence relation!

22 Provability Suppose we have a class of structures C and we want to prove something about this class. Suppose we can write a set of formulas such that a structure S is in that class iff S satisfies all the formulas in (with having no free variables). Then every property of the structures in C satisfies that |==. Proof: every structure that satisfies all the formulas in is in C and therefore satisfies. Since we have completeness, |--, thus having allows us to prove.

23 A class of structures with infinite set of elements Let i be a sentence that says that we have at least i elements: 2 = x y (x=y), 3 = x y z (( (x=y)/\ (y=z))/\ (x=z)) … etc. Call these collection of sentences.

24 Some inexpressiveness of first order logic We want to say that we have a finite number of elements in our domain. Suppose (for the contradiction) that we express exactly that using. Now, take and any finite subset of. It is satisfiable (by a structure with at least as many element as the highest index in the subset. Thus, every subset of is also satisfiable. By compactness, is also satisfiable – but it has an infinite model!!! Contradiction.

25 Having an algorithm for doing the proof? If |== then by completeness |--. We can enumerate all the possible proofs from. Say, each time to the i th step. Given enough memeory and time, if there is a proof, it would come out (recursive enumerable). On the other hand, one can write a set of formulas describing the behavior of a model equivalent to Turing machines, and a formula describing termination. Therefore, proving |-- is not decidable.

26 The big picture For some classes of structures C we can find a set of first order formulas that are satisfied exactly by structures in C. For some other structures C, there cannot be such a set of formulas (even an infinite set). Inexpressiveness of FOL. In case we can find the set of formulas and is a property of C, then we can use our (complete) proof system to prove |--. This will imply that is a property of C. But while the proof exists, we do not have a decision procedure that will check whether |-- and there is no limit on the amount of time and space needed for reaching such a proof when it exists.


Download ppt "Completeness and Expressiveness. תזכורת למערכת ההוכחה של לוגיקה מסדר ראשון : אקסיומות 1. ) ) (( 2. )) ) (( )) ( ) ((( 3. ))) F( F( ( 4. ) v) ( ) v (("

Similar presentations


Ads by Google