/***************************************************************** File : test_var.c RCS : $Id: test_var.c,v 1.1 2000-03-10 05:17:23 dmo Exp $ Author : Peter Schachte Origin : Tue Jul 18 14:28:15 1995 Purpose : Timing test for bryant graph var_entailed function *****************************************************************/ #include #include #include "bryant.h" #include "timing.h" #define VARLIMIT 1024 int opcount; void usage(char *progname) { printf("usage: %s size maxvar [repetitions]\n", progname); printf(" creates all possible v <-> v1 & v2 & ... & vsize functions and conjoins this\n"); printf(" with each variable between 0 and maxvar, and then determines for each variable\n"); printf(" between 0 and maxvar if that variable is entailed by this function.\n"); printf(" V and the vi are between 0 and maxvar inclusive. If repetitions is >0,\n"); printf(" this will be done that many times.\n"); } void init_array(int top, int v0, int array[]) { int i, val; for (i=0, val=0; i=VARLIMIT) { usage(argv[0]); printf("\n varmax must be between 1 <= varmax < %d\n", VARLIMIT); 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 (v0=0; v00; --reps) { for (v0=0; v0