Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. johanprolog

    counting atoms/ elements in list (new at prolog)

    got the element part right but still not sure about the atom part. len([],0). len([_|T],N) :- len(T,M),N is M+1. ?- len([[1,2],[3,4],4,5]). X = 3; Atoms should be X = 6; any help or where can I look on the web?
  2. johanprolog

    counting atoms/ elements in list (new at prolog)

    % to get elements in list mymember(X,[X|_]). mymember(X,[_|T]) :- mymember(X , T). ?- mymember(X,[a,b,[1,2,3],c]). X = a ; X = b ; X = [1, 2, 3] ; X = c ; %to get atoms in list. mymember(X,[X|_]). mymember(X,[_|T]) :- mymember(X , T). mymember(X,[H|_]) :- mymember(X , H). ?-...

Part and Inventory Search

Back
Top