I hi think this might be what you are looking for:
lts([],[]).
lts([H|T1],[H|T2]) :-
not(member(H,T1)),
lts(T1,T2).
lts([H|T1],T2) :-
member(H,T1),!,
lts(T1,T2).
by the way i would define the member/2 predicate like that so you dont get singelton variable warnings...
top_person(X) :-
is_bewlow(_,X),
not(is_below(X,_)).
higher(X,Y) :-
bewlow(Y,X).
higher(X,Y) :-
below(Y,X1),
higher(X,X1).
this of course only works if is_below(X,Y) means that X is below Y, so Y is higher than X. Why do i say this? because u didnt say how to interpret ur fact...
well actually i dont know where to start... the list of things which i have to say is long :)
(sorry im just teasing)
first of all ur member predicate. i dont know which Prolog you are using but my implementation has already a built-in member predicate. thus i get an error if i start ur script...
well actually i dont know anything about first search but i tried to make a program that does what u want.
I use SWI-Prolog so i am not sure if it works for u. It needs 3 built-in predicates:
sub_atom, atom_concat and atom_length
first_search(Word1,Word2,Result) :- fs(Word1,Word2,1,Result)...
Hello,
i made this one for you. Works well for me.
dividers(Number,List) :- dv(number,1,List).
dv(Number,Number,[Number]).
dv(Number,Akk,[Akk|Tail]) :-
Number > Akk,
0 is NUmber mod Akk,
AkkNew is Akk+1,
dv(Number,AkkNew,Tail).
dv(Number,Akk,List) :-
Number > Akk,
not(0...
i dont know about turbo Prolog but if there is XPCE for it u can use graphics.
I use SWI-Prolog where XPCE is integrated. XPCE is a package for object orientated programmin in Prolog. It comes with many defined objects e.g graphicals, windows, dialogs, textitems and all teh stuff u need.
I did...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.