Skip to content
Snippets Groups Projects
Commit e27af931 authored by Michael Leuschel's avatar Michael Leuschel
Browse files

update notebooks

parent 4b876e81
No related branches found
No related tags found
No related merge requests found
%% Cell type:markdown id:05d7c16f tags: %% Cell type:markdown id:4f85588b tags:
## Die Ackermann Funktion ## Die Ackermann Funktion
%% Cell type:code id:dc177e49 tags: %% Cell type:code id:fba4a5ee tags:
``` prolog ``` prolog
ack(0,N,R) :- !, R is N+1. ack(0,N,R) :- !, R is N+1.
ack(M1,0,R) :- !, M is M1-1, ack(M,1,R). ack(M1,0,R) :- !, M is M1-1, ack(M,1,R).
ack(M1,N1,R) :- M is M1-1, N is N1-1, ack(M1,N,R1),ack(M,R1,R). ack(M1,N1,R) :- M is M1-1, N is N1-1, ack(M1,N,R1),ack(M,R1,R).
``` ```
%% Cell type:code id:4adf4ed2 tags: %% Cell type:code id:64a68f66 tags:
``` prolog ``` prolog
?- ack(1,1,R). ?- ack(1,1,R).
``` ```
%% Output %% Output
%% Cell type:code id:c26e7fa4 tags: %% Cell type:code id:0ff57d9f tags:
``` prolog ``` prolog
?- ack(1,2,R). ?- ack(1,2,R).
``` ```
%% Output %% Output
%% Cell type:code id:d682c1fc tags: %% Cell type:code id:190a83b9 tags:
``` prolog ``` prolog
?- ack(3,3,R). ?- ack(3,3,R).
``` ```
%% Output %% Output
%% Cell type:code id:0e1603db tags: %% Cell type:code id:3617d235 tags:
``` prolog ``` prolog
?- ack(3,5,R). ?- ack(3,5,R).
``` ```
%% Output %% Output
%% Cell type:code id:41d483da tags: %% Cell type:code id:5c189808 tags:
``` prolog ``` prolog
?- ack(3,6,R). ?- ack(3,6,R).
``` ```
%% Output %% Output
%% Cell type:code id:19e3c25f tags: %% Cell type:code id:ed5076a9 tags:
``` prolog ``` prolog
?- ack(4,0,R). ?- ack(4,0,R).
``` ```
%% Output %% Output
%% Cell type:code id:95f45975 tags: %% Cell type:code id:0097f444 tags:
``` prolog ``` prolog
``` ```
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment