domains
List = integer*
Sorted = integer*
Rest = integer*
predicates
Bsort(List,List)
Swap(List,List)
clauses
Bsort(List,Sorted):-
Swap(List,List1),!,
Bsort(List1,Sorted).
Bsort(Sorted,Sorted).
Swap([X,Y|Rest],[Y,X|Rest]):- X>Y.
Swap([Z|Rest],[Z|Rest1]):-
Swap(Rest,Rest1).
Labels
- BFS (1)
- BNM (1)
- crypt arithmetic puzzle (1)
- depth first search (1)
- monkey banana problem (1)
- n-queen Problem (1)
- Tower of hanoi (1)
- water jug problem (1)
Tuesday, July 3, 2007
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment