Prolog - Array Dinamico en Prolog

 
Vista:

Array Dinamico en Prolog

Publicado por gina (1 intervención) el 16/07/2008 03:15:54
Hola,

Estoy haciendo un ejercicio en Prolog para resolver los problemas de una maquina de Vectores que son:

1.A vector is a tuple of integers, such as (0,2,5).

2.An update is simply a vector that is added to another vector. For example, (0,1,-1) is an update (and therefore also a vector). When it is applied to the vector (0,2,5), the result is a new vector (0+0, 2+1, 5-1)=(0,3,4).

3.A template is a tuple of patterns. Each pattern is either an integer x, a condition of the form "< x" or "> x" (where x is some integer), or "*". A template (p1, p2, ..., pn) matches a vector (x1, x2, ..., xk) if (1) they have the same length (so n=k), and (2) each pattern pi of the template matches the corresponding integer xi of the vector. If pi is an integer, it matches if it is equal to xi. If pi is a condition, it matches if the integer satisfies the condition. Lastly, if pi is *, it matches any integer.


4.An operation is a pair (T,U) where T is a template and U is an update. An operation (T,U) is enabled for a vector V if the template T matches V. If the operator is fired on vector V, the result is the new vector W that we obtain by applying update U to V. We often write this as V —(T,U)→ W.

Mi problema es que te pide que el array que le mandes como parámetro sea dinámico, lo cual al menos en Prolog no se me ocurre como hacerle, alguna idea?

La liga en la cual me base y que puede servir para terminarlo es: http://www.gprolog.org/manual/gprolog.html

Me urge!
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder