Prolog “sorted” predicate

My interest in Prolog was recently revived, after briefly courting the P vs NP problem, which, I was hoping, might be made solvable by the machine. While playing with the thing, I found a Prolog solution to the REVERSE game. The exercise is trivial, the point of it being merely to compare the implementation in various programming languages.

The interesting detail, however, is how the author of the Prolog solution tests if a list is sorted:
sorted(L) :- sort(L, L).

You can’t comment because I got bored with cleaning up after all the spammers and disabled comments altogether. ­čśÇ Long live DOS attacks (which btw are much older than technology – just try talking a woman out of her idea)!

To Iceland

Brave people of Iceland, do not let yourselves be robbed. Better to live a generation of isolation with an intact conscience that allows you to look your children in the eye than to succumb to the EU’s blackmails and endure a life of shame.

Those who know,,, know BDO what I’m talking about.


Back offline from a full day at work. The philosophical thoughts swarming through my mind this morning all gone. ItÔÇÖs amazing how ephemeral deep thinking can be for some.

Perhaps itÔÇÖs the music playing at this time, or maybe itÔÇÖs excitement in anticipation of tomorrowÔÇÖs events. Or maybe work just drains you of philosophical thoughts in much the same way boiling drains vegetables of their best ingredients.

Be it as it may, Depeche Mode is beating to my heart, tomorrow will be the companyÔÇÖs NERF wars final, and my destination is approaching quickly. I suspect I have no more than 6-7 minutes till the journal closes once again.

My thoughts now go to my unborn daughter and to her mom and my love. I miss them and want to touch thep pregnant belly ÔÇô that all so powerful symbol of life that dwarfs all prozaic human values in its majesty.

My station comes next. Sayonara!


Vreau în prezenta să discut o problemă nu specifică românei, ci valabilă în orice limbă.

N-am cuno╚Ötin╚Ťe suficiente s─â fac din articol un eseu de calitate vorbind despre stil, dar o s─â remarc dou─â-trei mici euristici care, dac─â le internalizezi, te vor ajuta s─â vorbe╚Öti mai clar.

Evit─â propozi╚Ťiile prea lungi si pe cele prea scurte. Dac─â ai scris o secven╚Ť─â de propozi╚Ťii scurte, ├«ncearc─â s─â une╚Öti unele dintre ele, gerunziul poate fi util ├«n procesul de unire. O secven╚Ť─â de fraze lungi ╚Öi greu de ├«n╚Ťeles poate fi corectat─â rup├ónd fraza ├«n mai multe propozi╚Ťii.

Exprim─â clar rela╚Ťiile de cauzalitate, cauz─â ╚Öi efect. Dac─â Iulia a cump─ârat un bilet de avion ca urmare a ├«ntoarcerii lui Marius, compar─â┬á“Marius s-a ├«ntors din Ungaria, iar Iulia a cump─ârat un bilet de avion”┬ácu┬á“Marius s-a ├«ntors, provoc├ónd-o pe Iulia s─â cumpere un bilet de avion”.

Exprim─â clar identiatea celor ce efectueaz─â ac╚Ťiunile ├«n situa╚Ťiile unde sensul poate deveni ambiguu.

Aten╚Ťie la num─ârul feluritelor componente ale propozi╚Ťiei. Am remarcat probleme la expresii cum ar fi┬á“i l-am transmis” ├«n┬á“I-ai transmis mesajul Mariei? — I (ei, Mariei) l (pe el, mesajul)-am trimis.”, care se transform─â ├«n┬á“i le-am trimis” dac─â ne referim la mai mult de un mesaj, sau ├«n┬á“li l-am trimis” dac─â e vorba de mai multe persoane ce trebuie s─â primeasc─â mesajul.┬á“Li le-am”,┬á“li l-am”,┬á“li i-am” sun─â nenatural, dar sunt corecte.

Evit─â expresiile-cli╚Öeu; folose╚Öte ├«n schimb sinonime acceptate, nu bombastice sau pedante. ├Änlocuie╚Öte-l, de pild─â, pe┬á“a veni” cu┬á“a se ├«ntoarce” sau cu┬á“a ni se al─âtura” ╚Öamd, dup─â caz; pe┬á“am v─âzut” cu┬á“am ├«nt├ólnit (probleme)”, dar e ├«n regul─â┬á“am v─âzut (oameni ├«n tramvai)”.