Created
October 2, 2015 03:08
-
-
Save rcotrina94/a5d314858eaf83c7bfbc to your computer and use it in GitHub Desktop.
Visual Prolog: Insertar un elemento al inicio de una lista
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% Copyright Richard Cotrina ©2015 | |
class main | |
open core | |
domains | |
lista = integer*. | |
predicates | |
insInicio : (lista, integer, lista) procedure (i,i,o). | |
predicates | |
run : core::runnable. | |
end class main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% Copyright Richard Cotrina ©2015 | |
implement main | |
open core | |
clauses | |
insInicio(L, E, [E|L]). | |
clauses | |
run() :- | |
Lista = [2,3,4], | |
insInicio(Lista, 1, NuevaLista), | |
stdio::write(NuevaLista), | |
programControl::sleep(4000), | |
succeed. | |
end implement main | |
goal | |
console::runUtf8(main::run). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment