Exercici 4.2 Trobeu totes les possibles resolvents (si n'hi ha) <strong>de</strong>ls següents parells <strong>de</strong> clàusules: a) C = ¬P(X) ˅ Q(X,b) D = P(a) ˅ Q(a,b) b) C = ¬P(X) ˅ Q(X,X) D = ¬Q(a,f(a)) c) C = ¬P(X,Y,U) ˅ ¬P(Y,Z,V) ˅ ¬P(X,V,W) ˅ P(U,Z,W) D = P(g(X,Y),X,Y) d) C = ¬P(V,Z,V) ˅ P(W,Z,W) D = P(W,h(X,X),W) Exercici 4.3 Demostreu <strong>la</strong> inconsistència tot utilitzant l'estratègia lock resolution <strong>de</strong>ls següents conjunts <strong>de</strong> clàusules S: a) S = {5P(y,a) ˅1P(f(y),y), 6P(y,a) ˅2P(y,f(y), 8¬P(x,y) ˅3P(f(y),y), 9¬P(x,y) ˅4P(y,f(y)), 10¬P(x,y) ˅ 7¬P(y,a) } b) S = { 1¬E(x) ˅ 2S(x) ˅ 3S(x,f(x)), 4¬E(x) ˅ 5V(x) ˅ 6C(f(x)), 2P(a), 8E(a), 9¬S(a,y)˅10P(y), 11¬P(x) ˅ 12¬V(x), 13¬P(x) ˅ 14¬C(x) } c) S = { 1P(g(x,y),s,y), 2¬P(x,h(x,y),y), 3¬P(x,y,u) ˅ 4P(y,z,v) ˅ 5¬P(x,v,w) ˅ 6P(u,z,w), 7¬P(k(x),x,k(x)) } Exercici 4.4 Demostreu <strong>la</strong> inconsistència tot utilitzant l'estratègia linear resolution <strong>de</strong>ls següents conjunts <strong>de</strong> clàusules S. Digueu per cada cas si és input o unit, si ho pot ser. a) S = { ¬E(x) ˅ V(x) ˅ S(x,f(x)), ¬E(x) ˅ V(x) ˅ C(f(x)), P(a), E(a), ¬S(a,y)˅ P(y), ¬P(x) ˅ ¬V(x), ¬P(x) ˅ ¬C(x) } Useu l'última clàusu<strong>la</strong> com a clàusu<strong>la</strong> top. b) S = { P(x,i(x),e), ¬S(x) ˅ ¬S(y) ˅ ¬P(x,i(x),z) ˅ S(z), S(a), ¬S(e) } Useu l'última clàusu<strong>la</strong> com a clàusu<strong>la</strong> top. c) S = { P(i(x),x,e), P(e,x,y), ¬P(x,y,u) ˅ ¬P(y,z,v) ˅ ¬P(u,z,w) ˅ P(x,v,w), ¬P(v,y,u) ˅ ¬P(y,z,v) ˅ ¬P(x,v,w) ˅ P(u,z,w), ¬P(a,x,e) } Resoleu-lo utilitzant input i unit resolution. d) S = { D(x,x), ¬D(x,y) ˅ ¬D(y,z) ˅ D(x,z), P(x)˅D(g(x),x), P(x) ˅ L(b,g(x)), P(x)˅ L(g(x),x), L(b,a),¬P(x)˅¬D(x,a),¬L(b,x)˅ ¬L(x,a)˅ P(f(x)),¬L(b,x)˅¬L(x,a)˅ D(f(x),x) } Resoleu-lo utilitzant input i unit resolution. 170
Exercici 4.5 Tenim les dues premisses següents: Tots els acudits són per riure: (∀X)( Acudit(X) → Riure(X) ) Cap acte <strong>de</strong> congrés és un acudit: (∀X)( Acte(X) → ¬Acudit(X) ) Po<strong>de</strong>m respondre amb aquestes da<strong>de</strong>s a <strong>la</strong> pregunta següent? L<strong>la</strong>vors, cap acte <strong>de</strong> congrés no és per riure? (∀X)( Acte(X) → ¬Riure(X) ) Raoneu-ho i <strong>de</strong>mostreu-ho en el cas que es pugui respondre. Exercici 4.6 Estem realitzant en CP1 <strong>la</strong> carta <strong>de</strong>l Bar <strong>de</strong>l Lluçanès. El menú que podria correspondre a un dia es pot composar d'un primer p<strong>la</strong>t, un segon p<strong>la</strong>t <strong>de</strong> carn o peix i les postres. Imaginem-nos que tenim representats tots els p<strong>la</strong>ts possibles que pot arribar a cuinar el nostre xef: PrimerP<strong>la</strong>t(sopa_<strong>de</strong>_ceba), PrimerP<strong>la</strong>t(macarrons), SegonP<strong>la</strong>t(carn, pol<strong>la</strong>stre), SegonP<strong>la</strong>t(carn,entrecotte),SegonP<strong>la</strong>t(peix,sardina), SegonP<strong>la</strong>t(peix,mariscada), Postres(poma), Postres(pastís_<strong>de</strong>_poma), Postres(f<strong>la</strong>m), Postres(iogurt) I el menú és <strong>la</strong> composició <strong>de</strong> tots aquests p<strong>la</strong>ts: ∀XYZS (PrimerP<strong>la</strong>t(X) ˄ SegonP<strong>la</strong>t(Y,Z) ˄ Postres(S) → Menu(Y,X,Z,S)) Demostreu formalment, tot aplicant Resolució, les següents preguntes: a) és un primer p<strong>la</strong>t macarrons? b) existeix un menú <strong>de</strong> peix? c) quina carn po<strong>de</strong>m menjar si escollim <strong>de</strong> menú macarrons <strong>de</strong> primer i iogurt <strong>de</strong> postres?. d) hi ha algun menú <strong>de</strong> carn que inclogui sopa <strong>de</strong> ceba i <strong>de</strong> postres mousse <strong>de</strong> xoco<strong>la</strong>ta? e) quines són les opcions <strong>de</strong> menú que po<strong>de</strong>m escollir si sabem segur que volem mariscada <strong>de</strong> segon p<strong>la</strong>t? Significat <strong>de</strong>ls predicats: PrimerP<strong>la</strong>t(X): X és un primer p<strong>la</strong>t. SegonP<strong>la</strong>t(X,Y): Y és un segon p<strong>la</strong>t <strong>de</strong> X. Postres(X): X és p<strong>la</strong>t <strong>de</strong> postres. Menú(Y,X,Z,S): El menú <strong>de</strong> Y (carn o peix en aquest cas) es composa d'un primer p<strong>la</strong>t X, un segon p<strong>la</strong>t Z i uns postres S. 171
- Page 3:
Vostè és lliure de: Creative Comm
- Page 7 and 8:
Índex SESSIÓ 1: Una introducció
- Page 9 and 10:
4 Programació lògica/Prolog .....
- Page 11 and 12:
SESSIÓ 1: Una introducció FITXA D
- Page 13 and 14:
anys després, és quan podem dir q
- Page 15:
Les lògiques es classifiquen en l
- Page 18 and 19:
per notar la negació (“no”), l
- Page 21 and 22:
SESSIÓ 3: Interpretacions, conseq
- Page 23 and 24:
Fórmula inconsistent Si per a tote
- Page 25 and 26:
SESSIÓ 4: Problemes FITXA DE LA SE
- Page 27 and 28:
SESSIÓ 5: Formes normals i Clàusu
- Page 29 and 30:
Formalment s’anomena àlgebra de
- Page 31:
Demostrar l’equivalència de dues
- Page 34 and 35:
Teorema P és un teorema si P és d
- Page 36 and 37:
Farem servir aquest teorema en les
- Page 38 and 39:
Demostració de teoremes Demostreu
- Page 40 and 41:
Instància EQ1. ( α ∧ ß ) ≡
- Page 43 and 44:
SESSIÓ 9: Problemes FITXA DE LA SE
- Page 45 and 46:
SESSIÓ 10: Teoria de la demostraci
- Page 47 and 48:
de manera que, i cada Ci o és una
- Page 49 and 50:
SESSIÓ 11: Teoria de la demostraci
- Page 51 and 52:
SESSIÓ 12: Representació del cone
- Page 53 and 54:
Implicació ( Si ... aleshores... )
- Page 55 and 56:
SESSIÓ 13: Propietats FITXA DE LA
- Page 57 and 58:
SESSIÓ 14: Sintaxi FITXA DE LA SES
- Page 59 and 60:
són fbf. iii. Si F és una fbf i x
- Page 61 and 62:
SESSIÓ 15: Interpretacions, conseq
- Page 63 and 64:
Exemple La fórmula: (∀x) P(x) de
- Page 65 and 66:
SESSIÓ 16: Problemes FITXA DE LA S
- Page 67 and 68:
SESSIÓ 17: Formes normals i clàus
- Page 69 and 70:
Definició de Forma Normal Prenexa
- Page 71:
RESUM En aquesta sessió s’han es
- Page 74 and 75:
Exemples de substitució λ = {f(z)
- Page 76 and 77:
Procés: Pas1. Sigui k = 0, σ k =
- Page 78 and 79:
Exemple Sigui C = P(x) ∨ P(f(y))
- Page 80 and 81:
1. ¬Hombre(x) ∨ Mortal(x) 2. Hom
- Page 82 and 83:
Algorisme de Robinson Feu els exerc
- Page 84 and 85:
edundants són aquelles que ja esta
- Page 87:
SESSIÓ 22: Estratègies de resoluc
- Page 90 and 91:
Les constants són considerades fun
- Page 93 and 94:
SESSIÓ 24: Representació del cone
- Page 95 and 96:
SESSIÓ 25: Propietats FITXA DE LA
- Page 97 and 98:
SESSIÓ 26: Introducció a la progr
- Page 99 and 100:
1. Clàusules amb un literal positi
- Page 101 and 102:
De la demostració a l’execució
- Page 103 and 104:
4.2.4 Programació procedural enfro
- Page 105 and 106:
Visual Prolog Des dels orígens de
- Page 107 and 108:
SESSIÓ 27: L’execució d’un pr
- Page 109 and 110:
L’execució L’execució d’un
- Page 111 and 112:
Estratègia d’execució (el contr
- Page 113 and 114:
[Prolog2001] Trobant totes les solu
- Page 115 and 116:
El predicat fail El backtracking es
- Page 117 and 118:
SESSIÓ 28: Dominis simples i opera
- Page 119 and 120:
Operacions aritmètiques Els domini
- Page 121 and 122:
SESSIÓ 29: Dominis compostos i ope
- Page 123 and 124:
Evidentment la declaració està in
- Page 125 and 126: SESSIÓ 30: Llistes FITXA DE LA SES
- Page 127 and 128: L’operador | indica que volem uni
- Page 129 and 130: 4.4.5 Problemes Arbre d’objectius
- Page 131 and 132: SESSIÓ 31: Lectura i escriptura FI
- Page 133 and 134: El predicat writef és igual que el
- Page 135 and 136: SESSIÓ 32: Fets dinàmics FTXA DE
- Page 137 and 138: Operacions sobre facts Els fets que
- Page 139 and 140: RESUM Amb la secció facts podem de
- Page 141 and 142: SESSIÓ 32: Altres característique
- Page 143 and 144: Annexos I Problemari CP0 Problemes
- Page 145 and 146: c) ( P ∧ Q ) → R , P ∨ R , Q
- Page 147 and 148: d) ¬A → ( A → B ) e) (A → ¬
- Page 149 and 150: Exercici 4.2 Demostreu l’equival
- Page 151 and 152: a) ( ( A ∧ B → C ) ∧ ( A →
- Page 153 and 154: a) ├ ( ( P → R ) ∧ ( Q → S
- Page 155 and 156: Exercici 7.8 Demostreu C utilitzant
- Page 157 and 158: Exercici 8.6 De tres amigues que co
- Page 159 and 160: Exercici 8.13 Completeu la taula de
- Page 161 and 162: Exercici 8.19 Per a cadascun dels s
- Page 163 and 164: c) El conjunt de clàusules { P ∨
- Page 165 and 166: Solució 3.1c ├ ( A → B ) → (
- Page 167 and 168: Solució 5.6a ╞ ( ( P ∧ Q ) →
- Page 169 and 170: Demostrem la inconsistència de: (
- Page 171 and 172: II Problemari CP1 Càlcul de Predic
- Page 173 and 174: Exercici 1.8 Una agència de viatge
- Page 175: a) δ1= {X/Y, f(a,g(b,h(X,a,c)))/Z}
- Page 179 and 180: 5. TEORIA DE MODELS EN CP1 Exercici
- Page 181 and 182: Exercici 5.9 Determineu si la fórm
- Page 183 and 184: Hi falta res? Exercici 6.9 Suposeu
- Page 185 and 186: a conjunt clausal. ∀ X∀Y( ∃Zp
- Page 187 and 188: σ1= { f(a,b)/Z, f(a,b)/X } no hi h
- Page 189 and 190: III Exercicis pràctics de Prolog E
- Page 191 and 192: edat (paul,36). edat (tom,15). dd(X
- Page 193 and 194: Exercici 9 Tenim els següents domi
- Page 195 and 196: Exercici 13 Una col·lecció d'ente
- Page 197 and 198: Implementeu en Prolog les següents
- Page 199 and 200: c) unio(nom,nom,nom) (i,i,o), crea
- Page 201 and 202: Exercici 20 Sigui els següents dom
- Page 203 and 204: Glossari Abast L’abast d’un qua
- Page 205 and 206: Decidible Un Sistema Formal és dec
- Page 207 and 208: 2- Si G és una fbf llavors (¬G)
- Page 209 and 210: Premissa, premisses Enunciat del qu
- Page 211 and 212: 3- Si f és una funció n-ària i t
- Page 213: Bibliografia LLIBRES Symbolic Logic