Diferencia entre revisiones de «Final 09/03/2017 (Paradigmas)»

De Cuba-Wiki
Sin resumen de edición
(Formato)
Línea 1: Línea 1:
1. Para cada afirmación decidir si es verdadera o falsa y justificar:
# Para cada afirmación decidir si es verdadera o falsa y justificar:
 
## <math> \forall </math> término M <math> \in \lambda^{bn} </math>, si <math> \emptyset \vdash M : \sigma </math> es derivable, entonces existe un valor <math>V</math> tal que <math> fix \ M \twoheadrightarrow V </math>
a) <math> \forall </math> término M <math> \in \lambda^{bn} </math>, si <math> \emptyset \vdash M : \sigma </math> es derivable, entonces existe un valor <math>V</math> tal que <math> fix \ M \twoheadrightarrow V </math>
## <math> \exists M \in \lambda^{bn}, \ \emptyset \vdash M : \sigma </math> es derivable, y hay un valor <math> V </math> tal que <math> fix \ fix \ M \twoheadrightarrow V </math> y <math> fix \ M \twoheadrightarrow V </math>
 
# Sea M un término tal que <math> \emptyset \vdash M : \sigma </math>, sea <math> W(ERASE(M)) = \Gamma \vdash M' : \rho </math>, decidir si es posible que:
b) <math> \exists M \in \lambda^{bn}, \ \emptyset \vdash M : \sigma </math> es derivable, y hay un valor <math> V </math> tal que <math> fix \ fix \ M \twoheadrightarrow V </math> y <math> fix \ M \twoheadrightarrow V </math>
## <math> \sigma \neq \rho </math>
 
## <math> \sigma = \rho, \ M \neq M' </math>
2. Sea M un término tal que <math> \emptyset \vdash M : \sigma </math>, sea <math> W(ERASE(M)) = \Gamma \vdash M' : \rho </math>, decidir si es posible que:
# Sea un lenguaje orientado a objetos donde no se permite sobrecarga, decidir si las siguientes situaciones son admitidas por el sistema de tipos o no. Justificar.
 
## Se sobrescribe el método de una clase y se reemplaza el tipo del argumento por un subtipo del tipo que tenía en la superclase.
a. <math> \sigma \neq \rho </math>
## Se tiene un atributo de tipo ref t (es un atributo mutable), se lo sobrescribe en una subclase por un tipo ref s, donde s es subtipo de t.
 
# Decidir si es verdadero o falso:
b. <math> \sigma = \rho, \ M \neq M' </math>
## {P(x, y)} y {P(y, f(y)} no unifican.
 
## <math> \forall x. \forall y. P(x, f(x)) \ \wedge \ \lnot P(y, f(y)) </math> es una forma normal de Skolem de <math> \forall x. \forall y. \exists z. P(x, z) \ \wedge \ \lnot P(y, z) </math>.
3. Sea un lenguaje orientado a objetos donde no se permite sobrecarga, decidir si las siguientes situaciones son admitidas por el sistema de tipos o no. Justificar.
## Sea un programa de Prolog con unicas clausulas: "P(X,Y) :- q(X). P(X,Y) :- q(Y)", la expresion "q(X), ~q(Y)" aparece en el arbol de busqueda de Prolog de "P(X,X), ~P(Y,Y)".
 
# Sea un programa en Prolog que redefine el "not" como:
a) Se sobrescribe el método de una clase y se reemplaza el tipo del argumento por un subtipo del tipo que tenía en la superclase.
 
b) Se tiene un atributo de tipo ref t (es un atributo mutable), se lo sobrescribe en una subclase por un tipo ref s, donde s es subtipo de t.
 
4. Decidir si es verdadero o falso:
 
a. {P(x,y)} y {P(y, f(y))} no unifican.
 
b. para_todo(x), para_todo(y) (P(x,f(x)) ^ ~P(y,f(y))) es una forma normal de Skolem de para_todo(x), para_todo(y), existe(z) (P(x,z) ^ ~P(y,z)).
 
c. Sea un programa de Prolog con unicas clausulas: "P(X,Y) :- q(X). P(X,Y) :- q(Y)", la expresion "q(X), ~q(Y)" aparece en el arbol de busqueda de Prolog de "P(X,X), ~P(Y,Y)".
 
5. Sea un programa en Prolog que redefine el "not" como:
 
not(G) :- call(G), fail, !.
not(G) :- call(G), fail, !.
not(G).
not(G).
Comparar el resultado de evaluar not(P) si el arbol de resolucion SLD de P es:
Comparar el resultado de evaluar not(P) si el arbol de resolucion SLD de P es:
 
## finito y sin solución
a. finito y sin solución
## finito y con solución
 
## infinito y con solución
b. finito y con solución
#Seguimiento en Smalltalk
 
c. infinito y con solución
 
6. Seguimiento en Smalltalk

Revisión del 13:40 2 sep 2020

  1. Para cada afirmación decidir si es verdadera o falsa y justificar:
    1. término M , si es derivable, entonces existe un valor tal que
    2. es derivable, y hay un valor tal que y
  2. Sea M un término tal que , sea , decidir si es posible que:
  3. Sea un lenguaje orientado a objetos donde no se permite sobrecarga, decidir si las siguientes situaciones son admitidas por el sistema de tipos o no. Justificar.
    1. Se sobrescribe el método de una clase y se reemplaza el tipo del argumento por un subtipo del tipo que tenía en la superclase.
    2. Se tiene un atributo de tipo ref t (es un atributo mutable), se lo sobrescribe en una subclase por un tipo ref s, donde s es subtipo de t.
  4. Decidir si es verdadero o falso:
    1. {P(x, y)} y {P(y, f(y)} no unifican.
    2. es una forma normal de Skolem de .
    3. Sea un programa de Prolog con unicas clausulas: "P(X,Y) :- q(X). P(X,Y) :- q(Y)", la expresion "q(X), ~q(Y)" aparece en el arbol de busqueda de Prolog de "P(X,X), ~P(Y,Y)".
  5. Sea un programa en Prolog que redefine el "not" como:

not(G) :- call(G), fail, !. not(G). Comparar el resultado de evaluar not(P) si el arbol de resolucion SLD de P es:

    1. finito y sin solución
    2. finito y con solución
    3. infinito y con solución
  1. Seguimiento en Smalltalk