ProLog

ProLog Vrs (Haoh=#)1:

ProLog Uv Mohst Ywzd Smahrt Tek Langz Uv Thuh SmahrT Tek Langz Tot Heer
* Uv Thuh Smahrt Tek Saiz Ohmz Uv Thuh ReeL Prwvd TrwTh Saiz Ohmz
* Uv Thuh AhL Spundj STeiT Saiz Ohmz Uv Thuh AhL STeiT Saiz Ohmz Peidj LisT.

ISO ProLog Vrs (Haoh=#)1:

ISO ProLog Uv ProLog Uv Mohst Ywzd Smahrt Tek Langz Uv Thuh SmahrT Tek Langz Tot Heer
* Uv Thuh Smahrt Tek Saiz Ohmz Uv Thuh ReeL Prwvd TrwTh Saiz Ohmz
* Uv Thuh AhL Spundj STeiT Saiz Ohmz Uv Thuh AhL STeiT Saiz Ohmz Peidj LisT.

These web pages describe the ISO conformant version of the Prolog language. The pages are in several parts:

A history and overview of the standard;
The builtin predicates and control constructs of the language;
Prolog semantics;
Test suites Test of conformance to the ISO standard;
Input Output in ISO Prolog;
http://www.deransart.fr//prolog/exceptions.html Exception Handling in ISO Prolog]
The modules proposal;
A Prolog Bibliography.

Description of the ISO conformant version of the Prolog language.

ISO/IEC 13211 - Programming language - Prolog

ProLog 0123Tree Vrs (Haoh=#)1:

//Prolog// Programming for Artificial Intelligence.//pdf// - Higher Intellect…Printed in Great Britain bv Commercial Colour Press. British Library Cataloguing in Publication Data. Bratko. Ivan. Prolog programming for artificial intelligence.

ProLog 0123Tree Vrs (Haoh=#)1:

[pdf pg 256] pg 238 PROLOG PROGRAMMING FOR ARTIFICIAL INTELLIGENCE
% Insertion and deletion in the vertically balanced 2-3 dictionary

newtree:[0,[]];

ins(n0, X): [n(1,[X])];

Nohd(VaL):[1,[VaL]];.

plus([0,[]],X):[1,[X]];

ins(n1(N), X): [n1(N), X, n1(x)] :- N < X;

ins123(n1(N), X): [n1(x), N, n1(N)] :- X < N;

ob(n1(N), {
ins(X): R :-
N < X, R = [n1(N), X, n1(X)];
X > N, R = [n1(X), N, n1(N)].
}).

ins123(n1(N),X): R :-
N < X, R = [n1(N), X, n1(X)];
X > N, R = [n1(X), N, n1(N)].

plus([1,[OhLd]], New):OwT_LisT :-
OhLd < New, OuTLisT = [ 2, [ [1,OhLd], [1,New] ] ];
New < Ohld, OuTList = [ 2, [ [1,New], [1,OhLd] ] ].

ins( n2(Li,M,Ri), X ): [T] :-
X < M, ins(Li, X): L,
( L=[T1], T=n2(T1,M,RT);
L=[LT, M2, MT], T=t3(LT,M2,MT,M,Ri)
);

ins(n2(L, M, R), X): [n3(LT, M2, MT, M, R)] :-
X < Mi, ins(L, X): [LT, M2, MT].

ins(n2(L, M, R), X): [n3(L, M, MT, M2, RT)] :-
Mi < X, ins(R, X): [MT, M2, RT].

ins(n2(Li, M, Ri), X): [T] :-
( M < X, ins(Ri, X): L);
X < M, ins(Li, X): L)
),(
L=[T], T=n2(L, M, T);
L=[MT,M2,RT], T=n3(Li,M,MT,m2,RT)
).

ins(n3(TL,ML,TM,MR,TR), X): [n3(NL,ML,MT,MR,RT)] :-
x < ML, ins(TL, X): [NL];

ins(n3(TL,ML,TM,MR,TR), X): [n2(n(NL,NM,NR),ML,n2(TM,MR,TR)] :-
x < ML, ins(TL, X): [NL.NM,NR];

ins(n3(TL,ML,TM,MR,TR), X): [n3(TL,ML,MT,MR,NR)] :-
MR < X, ins(TR, X): [NR];

ins(n3(TL,ML,TM,MR,TR), X): [n2(n(TL,ML,TM),ML,n2(NL,NM,NR)] :-
MR < X, ins(TR, X): [NL.NM,NR];

ins(n3(TL,ML,TM,MR,TR), X): [n3(TL,ML,NT,MR,tR)] :-
ML < X, x < MR, ins(TM, X): [NT];

ins(n3(TL,ML,TM,MR,TR), X): [n2(n(TL,ML,NL),NM,n2(NR,Mr,TR)] :-
ML < X, x < MR, ins(TM, X): [NL.NM,NR];

ins123(n3(TL,ML,TM,MR,TR),X): RL :-
X < ML, ins(TL,X):L, (
L=[NL], RL=[n3(NL,ML,MT,MR,RT)];
L=[NL.NM,NR], RL=[n2(n(NL,NM,NR),ML,n2(TM,MR,TR)]
);
MR < X, ins(TR,X): L, (
L=[NR], RL=[n3(TL,ML,MT,MR,NR)];
L=[NL.NM,NR], RL=[n2(n(TL,ML,TM),ML,n2(NL,NM,NR)]
);
ML < X, X < MR, ins(TM, X):L, (
L=[NT], RL=[n3(TL,ML,NT,MR,tR)];
L=[NL.NM,NR], RL=[n2(n(TL,ML,NL),NM,n2(NR,Mr,TR)]
);

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License