For Programmers: Free Programming Magazines  


Home > Archive > Prolog > November 2005 > benchmarks for element/3









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author benchmarks for element/3
Neng-Fa Zhou

2005-11-13, 9:56 pm

Hi,

I am looking for benchmarks for evaluating implementations of the element/3
constraint (element(I,L,V) is true if the Ith element of L is V). The only
benchmark I have is the car sequencing problem by Dincbas, Simonis and Van
Hentenryck. Does anybody know any other benchmarks?

Cheers,
Neng-Fa


Neng-Fa Zhou

2005-11-14, 7:00 pm

After a little thought, I made a program which uses element/3 to generate
permutations in permutation sort.

go:-
cputime(S),
top,
cputime(E),
T is E-S,
write(T), write(' milliseconds').

top:-
L=[16,35,90,42,88,6,40,42,64,48,46,5,90,
29,70],
length(SortedL,15),
sorted(SortedL),
permute_with_element(L,SortedL,Is),
alldifferent(Is),
labeling_ff(Is),
write(SortedL),nl,
write(Is),nl.

sorted([X]):-!.
sorted([X1,X2|Xs]):-
X1 #=< X2,
sorted([X2|Xs]).

permute_with_element(L,[],[]).
permute_with_element(L,[X|Xs],[I|Is]):-
element(I,L,X),
permute_with_element(L,Xs,Is).

"Neng-Fa Zhou" <nzhou@acm.org> wrote in message
news:4377f7c7$1@news.unimelb.edu.au...
> Hi,
>
> I am looking for benchmarks for evaluating implementations of the
> element/3 constraint (element(I,L,V) is true if the Ith element of L is
> V). The only benchmark I have is the car sequencing problem by Dincbas,
> Simonis and Van Hentenryck. Does anybody know any other benchmarks?
>
> Cheers,
> Neng-Fa
>
>



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com