Translations:Como executar o Prolog/16/en
Revisão de 11h12min de 28 de dezembro de 2020 por Abaffa (discussão | contribs) (Criou página com '<syntaxhighlight lang="Prolog"> ?- ['2_1.pl']. →1. Load a program from a local file: yes ?- listing(factorial/2). →2. List program to the screen: fact...')
<syntaxhighlight lang="Prolog"> ?- ['2_1.pl']. /* 1. Load a program from a local file*/ yes ?- listing(factorial/2). /* 2. List program to the screen*/
factorial(0,1).
factorial(A,B) :-
A > 0, C is A-1, factorial(C,D), B is A*D.
yes
?- factorial(10,What). /* 3. Compute factorial of 10 */ What=3628800
?- ['2_7.pl']. /* 4. Load another program */