1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
name = 'algol_if/3'
slug = 'interpreter za mini-algol z if stavkom'
description = '''\
<p>Razširi podano gramatiko za jezik mini-algol, da bo le-ta podprla uporabo stavka "if-then-else".
Privzemi, da morata obe veji (then in else) biti prisotni v stavku. Primer:</p>
<pre>
% if a < b then
% print(a)
% else
% print(b)
% end
?- _Program = [begin,if,a,<,b,then,print(a),else,print(b),end,end],
algol_if(_F, _Program, []),
apply([a=3,b=5], Output, _F).
Output = [a=3,b=5,printout=[3]].
</pre>
'''
hint = {}
|