noart prolog

deutsch.png Inhalt auf deutsch

Programming in logic

Is the meaning of Prolog. In "The Art of Prolog" by Sterling and Shapiro they say that Prolog is even a tool for thinking. I don't disagree.

surjektiv injektiv

Old people are advised to solve crossword puzzles for keeping a good working memory and mind. Therefore I need prolog. It's not my intention to keep also young people from solving crossword puzzles.

To get Prolog more popular there is a need for small real world application, examples doing somewhat useful.

There are many implementations of the Prolog language, compiler and interpreter. Which one you like to use is a question of personal needs and preferences.

Also available on WWW are interfaces to other languages like C, Java, SQL and so on.

The contributions I can offer at this time is a password generator, a very simple text to html encoder and a simple right2.gif JED Editor syntax-highlight mode. And maybe someone is interested in, because it's very special, perirun. It scans directories for executable files and simply executes them daily, weekly or monthly. I saw this kind of software originally as a shell script in a linux distribution.

+++ Commercial +++

Improve your results and revenue with zanox-affiliate

+++ Commercial End +++

% © GPL'ed written by sax
% Errors? Not tested! Drop a mail.

bijektiv(N, M) :- surjektiv(N,M), injektiv(N,M).

surjektiv([], M) :-
    list(M),
    true,
    !.
surjektiv([H|T], M) :-
    memberchk(H, M),
    surjektiv(T, M).

injektiv([], M) :-
    list(M),
    true,
    !.
injektiv([H|T], M) :-
    memberchk(H, M),
    select(H, M, Mrest),
    !,
    injektiv(T, Mrest).

/*
GNU Prolog perdicates:

list(Term) succeeds if Term is currently instantiated to a list, i.e. the atom [] (empty list) or a term with principal functor '.'/2 and with second argument (the tail) a list.
member(Element, List) succeeds if Element belongs to the List.
memberchk/2 is similar to member/2 but only succeeds once.
select(Element, List1, List2) removes one occurrence of Element in List1 to provide List2. This predicate is re-executable on backtracking.
*/

[Top] up.gif
Kaunter

mailto.png webmaster Zuletzt geändert: Montag, den 27. Oktober 03, 12:56:01h