Sign in
Google apps
Main menu
Post a Comment On:
Step by Step Tutorials
"Prolog Examples"
No comments yet. -
1 – 0 of 0
Basic Prolog Functions
1. Append
append([],Q,Q):-!.
append([H|T], Q, [H|T1]):- append(T, Q, T1).
2. Member
member(H,[H|T]):-!.
member(X, [H|T]):- member(X,T).
3. Intersect
intersect ([], L, []) :-!.
intersect ([H|T], L, L2):- member(H, L), intersect(T, L, L3), L2 = [H|L3], ! ;
intersect (T, L, L2).
4. Deletion
delete(X, [X], []) :- !.
delete(X, [X|T], T) :- !.
delete(X, [H|T], L) :- delete(X, T, L1), L=[H|L1].
posted by NurettinYAKIT at
13:31
on 26 Jan 2009
Leave your comment
You can use some HTML tags, such as
<b>, <i>, <a>
This blog does not allow anonymous comments.
Google Account
You will be asked to sign in after submitting your comment.
Please prove you're not a robot
"Prolog Examples"
No comments yet. -