10.06.2013 Views

Logica Matematica Corso di Laurea in Informatica ... - Mbox.dmi.unict.it

Logica Matematica Corso di Laurea in Informatica ... - Mbox.dmi.unict.it

Logica Matematica Corso di Laurea in Informatica ... - Mbox.dmi.unict.it

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

2.3. CALCOLO DELLA DEDUZIONE NATURALE 65<br />

Esercizio 2.3.12. Verificare che |= A ⊕ B → A ∨ B ma non viceversa.<br />

Esercizio 2.3.13. Spiegare perché A → A ⊕ B non è logicamente vera.<br />

Esercizio 2.3.14. Verificare che p ∨ q è equivalente a p ∨ (q ∧ ¬p) ed a<br />

p ⊕ (q ∧ ¬p).<br />

Esercizio 2.3.15. Verificare che la regola del sillogismo <strong>di</strong>sgiuntivo è corretta<br />

anche con ⊕ al posto <strong>di</strong> ∨.<br />

Esercizio 2.3.16. Notare che ¬(A ⊕ B) ≡ ¬A ⊕ B (provare a trovare frasi<br />

<strong>in</strong> <strong>it</strong>aliano che si possono <strong>di</strong>re bene <strong>in</strong> entrambi i mo<strong>di</strong>, e dove sia chiaro che<br />

la <strong>di</strong>sgiunzione è forte — non è facile per ¬(A ⊕ B)).<br />

Esercizio 2.3.17. Verificare se valgono le <strong>di</strong>stributive tra ∧ e ⊕.<br />

Esercizio 2.3.18. Verificare se valgono analoghe <strong>di</strong> De Morgan per ⊕ e ∧.<br />

Esercizio 2.3.19. Verificare se A ⊕ (B ⊕ C) ≡ (A ⊕ B) ⊕ C.<br />

Esercizio 2.3.20. In base al precedente esercizio, <strong>di</strong>scutere quando A1 ⊕<br />

. . . ⊕ An è vera.<br />

Esercizio 2.3.21. Verificare che ¬¬¬¬A ≡ A e che ¬¬¬¬¬¬¬A ≡ ¬A.<br />

Generalizzare.<br />

Esercizio 2.3.22. Si consideri il problema del merg<strong>in</strong>g <strong>di</strong> due liste List1 e<br />

List2 <strong>in</strong> una terza lista List3 (ad esempio nomi, <strong>in</strong> or<strong>di</strong>ne alfabetico).<br />

Una prima formulazione dell’algor<strong>it</strong>mo è la seguente: nello scorrere le<br />

due liste, se List1 non è esaur<strong>it</strong>a e List2 è esaur<strong>it</strong>a oppure l’elemento <strong>in</strong><br />

considerazione <strong>di</strong> List1 precede il primo non ancora <strong>in</strong>ser<strong>it</strong>o <strong>di</strong> List2, allora<br />

l’elemento <strong>di</strong> List1 è <strong>in</strong>ser<strong>it</strong>o <strong>in</strong> List3.<br />

Un’altra formulazione potrebbe essere la seguente: il prossimo elemento<br />

<strong>in</strong> List3 è preso da List1, ed è il primo elemento <strong>di</strong> List1 non ancora <strong>in</strong>ser<strong>it</strong>o,<br />

quando List1 non è esaur<strong>it</strong>a e List2 sì, oppure quando List1 non è esaur<strong>it</strong>a e<br />

l’elemento <strong>in</strong> considerazione <strong>di</strong> List1 precede il primo non ancora <strong>in</strong>ser<strong>it</strong>o <strong>di</strong><br />

List2.<br />

Usando lettere p, q, r per rappresentare rispettivamente “List1 non è esaur<strong>it</strong>a”,<br />

“List2 è esaur<strong>it</strong>a” e “l’elemento <strong>di</strong> List1 precede quello <strong>di</strong> List2”, scrivere<br />

le proposizioni corrispondenti alle due versioni delle con<strong>di</strong>zioni (che portano<br />

entrambe a mettere <strong>in</strong> List3 l’elemento <strong>in</strong> esame <strong>di</strong> List1), e <strong>di</strong>scutere<br />

se siano o no equivalenti, <strong>in</strong> base a quali leggi.<br />

Si noti che ovviamente nella prima versione c’è un’ambigu<strong>it</strong>à dovuta alla<br />

presenza <strong>di</strong> congiunzione e <strong>di</strong>sgiunzione; <strong>di</strong>scutere le due versioni e scegliere<br />

quella giusta.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!