/* ** Copyright (C) 1995,2003-2004 Peter Schachte and The University of Melbourne. ** This file may only be copied under the terms of the GNU Library General ** Public License - see the file COPYING.LIB in the Mercury distribution. */ /***************************************************************** File : test_abunify.c Author : Peter Schachte Origin : Fri Aug 4 14:39:44 1995 Purpose : Timing test for bryant graph MR_ROBDD_abstract_unify code *****************************************************************/ #include #include #include "bryant.h" #include "timing.h" int opcount; void usage(char *progname) { printf("usage: %s size maxvar [repetitions]\n", progname); printf(" for all possible v <-> v1 & v2 & ... & vsize functions, computes the MR_ROBDD_glb\n"); printf(" of that and each possible v <-> v1 & v2 & ... & vsize function, restricted\n"); printf(" to each threshold between 0 and maxvar. Each v and the vi are between 0\n"); printf(" and maxvar inclusive. If repetitions is >0, this will be done that many\n"); printf(" times.\n"); } void init_array(int top, int v0, int array[]) { int i, val; for (i=0, val=0; i0) { printf("%d", arr[0]); for (i=1; i=MR_ROBDD_MAXVAR) { usage(argv[0]); printf("\n varmax must be between 1 <= varmax < %d\n", MR_ROBDD_MAXVAR); return 20; } if ((size=atoi(argv[1]))<0 || size>=varmax) { usage(argv[0]); printf("\n size must be between 0 <= size < varmax\n"); return 20; } repetitions=(argc>3 ? atoi(argv[3]) : 1); if (repetitions <= 0) repetitions = 1; opcount = 0; clock0 = milli_time(); for (reps=repetitions; reps>0; --reps) { for (thresh=0; thresh<=varmax; ++thresh) { for (vf=0; vf0; --reps) { for (thresh=0; thresh<=varmax; ++thresh) { for (vf=0; vf