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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

PD Tema 3: Programación con Prolog<br />

Acumuladores<br />

Acumuladores<br />

◮ inversa(+L1,-L2), reverse(L1,L2), se verifica si L2 es la<br />

lista inversa <strong>de</strong> L1. Por ejemplo,<br />

�� �������������������<br />

� � ��� �� ��<br />

◮ Definición <strong>de</strong> inversa con append (no recursiva final):<br />

�����������������<br />

�������������������� ��<br />

�����������������<br />

������������������<br />

PD Tema 3: Programación con Prolog<br />

Acumuladores<br />

Acumuladores<br />

◮ Definición <strong>de</strong> inversa con acumuladores (recursiva final):<br />

���������������� ��<br />

������������������������<br />

����������������������<br />

���������������������������� ��<br />

�����������������������������<br />

Programación <strong>lógica</strong> e I.A. 57<br />

3 / 41<br />

4 / 41

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

Saved successfully!

Ooh no, something went wrong!