Revisión actual |
Tu texto |
Línea 1: |
Línea 1: |
| {{Back|Paradigmas de Lenguajes de Programación}}
| |
|
| |
| == Ejercicio 1 == | | == Ejercicio 1 == |
| a) | | a) |
Línea 34: |
Línea 32: |
|
| |
|
| == Ejercicio 2 == | | == Ejercicio 2 == |
| a)
| |
| II)
| |
| Forma lógica:
| |
| *1) <math>\forall t_1 \forall t_2 subclase(t_1, t_2) \implies subtipo(t_1, t_2)</math>
| |
| *2) <math>\forall t_1 subclase(t_1, t_1)</math>
| |
| *3) <math>\forall t_1 \forall t_2 (\exists t_3 subclase (t_3, t_2) \wedge extiende(t_1, t_3)) \implies subclase(t_1, t_2)</math>
| |
| *4) <math>extiende(perro, animal)</math>
| |
| *GOAL) <math>\forall x \neg subtipo(perro, x)</math>
| |
|
| |
| Forma clausal (<math>t = t_1, u = t_2, v = t_3</math>):
| |
|
| |
| 1)
| |
| *<math>\forall t \forall u \neg subclase(t, u) \vee subtipo(t, u)</math>
| |
| *<math>\{\neg subclase(t_1, u_1) \vee subtipo(t_1, u_1)\}</math>
| |
| 2)
| |
| *<math>\{subclase(t_2, t_2)\}</math>
| |
| 3)
| |
| *<math>\forall t \forall u (\neg \exists v subclase (v, u) \wedge extiende(t, v)) \vee subclase(t, u)</math>
| |
| *<math>\forall t \forall u (\forall v \neg subclase (v, u) \vee \neg extiende(t, v)) \vee subclase(t, u)</math>
| |
| *<math>\forall t \forall u \forall v \neg subclase (v, u) \vee \neg extiende(t, v) \vee subclase(t, u)</math>
| |
| *<math>\{\neg subclase (v_3, u_3) \vee \neg extiende(t_3, v_3) \vee subclase(t_3, u_3)\}</math>
| |
| 4)
| |
| *<math>\{extiende(perro, animal)\}</math>
| |
| GOAL)
| |
| *<math>\{\neg subtipo(perro, x_g)\}</math>
| |
|
| |
| b) | | b) |
| asignaciónValida(+declaraciones, ?asignacion) | | asignaciónValida(+declaraciones, ?asignacion) |