22.02.2013 Views

Temas de “Programación lógica e I.A.”

Temas de “Programación lógica e I.A.”

Temas de “Programación lógica e I.A.”

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.

184 Capítulo 8. Programación <strong>lógica</strong> con restricciones<br />

CLP sobre números racionales: CLP(Q)<br />

① CLP sobre números racionales: CLP(Q)<br />

[eclipse 1]: lib(clpq).<br />

Yes (0.66s cpu)<br />

[eclipse 2]: {X=2*Y, Y=1-X}.<br />

Y = 1 / 3<br />

X = 2 / 3<br />

Yes (0.00s cpu)<br />

PL 2004–05 CcIa Programación <strong>lógica</strong> con restricciones 8.13<br />

Planificación <strong>de</strong> tareas con CLP(Q)<br />

① Especificación <strong>de</strong> un problema mediante tareas y prece<strong>de</strong><br />

✉ tareas(+LTD) se verifica si LTD es la lista <strong>de</strong> los pares T/D <strong>de</strong> las tareas y sus dura-<br />

ciones.<br />

tareas([t1/5,t2/7,t3/10,t4/2,t5/9]).<br />

✉ prece<strong>de</strong>(+T1,+T2) se verifica si la tarea T1 tiene que prece<strong>de</strong>r a la T2.<br />

prece<strong>de</strong>(t1,t2).<br />

prece<strong>de</strong>(t1,t4).<br />

prece<strong>de</strong>(t2,t3).<br />

prece<strong>de</strong>(t4,t5).<br />

PL 2004–05 CcIa Programación <strong>lógica</strong> con restricciones 8.14

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

Saved successfully!

Ooh no, something went wrong!