aboutsummaryrefslogtreecommitdiff
path: root/src/benchmarks/espresso/equiv.c
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fl.fischer@fau.de>2020-05-06 16:56:32 +0200
committerFlorian Fischer <florian.fl.fischer@fau.de>2020-06-02 11:18:47 +0200
commit8174a918ea3b7cb216bf7ea98cfdc10661b5c37d (patch)
tree0747ec3ccb9f8d7eeccfac35977fc17855ca3bbb /src/benchmarks/espresso/equiv.c
parent8f52e8fc02dd235582f5961941bcd564e9a681cd (diff)
downloadallocbench-8174a918ea3b7cb216bf7ea98cfdc10661b5c37d.tar.gz
allocbench-8174a918ea3b7cb216bf7ea98cfdc10661b5c37d.zip
make the whole project more python idiomatic
* rename src directory to allocbench * make global variable names UPPERCASE * format a lot of code using yapf * use lowercase ld_preload and ld_library_path as Allocator members * name expected Errors 'err' and don't raise a new Exception * disable some pylint messages
Diffstat (limited to 'src/benchmarks/espresso/equiv.c')
-rw-r--r--src/benchmarks/espresso/equiv.c85
1 files changed, 0 insertions, 85 deletions
diff --git a/src/benchmarks/espresso/equiv.c b/src/benchmarks/espresso/equiv.c
deleted file mode 100644
index be10542..0000000
--- a/src/benchmarks/espresso/equiv.c
+++ /dev/null
@@ -1,85 +0,0 @@
-#include "espresso.h"
-
-
-find_equiv_outputs(PLA)
-pPLA PLA;
-{
- int i, j, ipart, jpart, some_equiv;
- pcover *R, *F;
-
- some_equiv = FALSE;
-
- makeup_labels(PLA);
-
- F = ALLOC(pcover, cube.part_size[cube.output]);
- R = ALLOC(pcover, cube.part_size[cube.output]);
-
- for(i = 0; i < cube.part_size[cube.output]; i++) {
- ipart = cube.first_part[cube.output] + i;
- R[i] = cof_output(PLA->R, ipart);
- F[i] = complement(cube1list(R[i]));
- }
-
- for(i = 0; i < cube.part_size[cube.output]-1; i++) {
- for(j = i+1; j < cube.part_size[cube.output]; j++) {
- ipart = cube.first_part[cube.output] + i;
- jpart = cube.first_part[cube.output] + j;
-
- if (check_equiv(F[i], F[j])) {
- printf("# Outputs %d and %d (%s and %s) are equivalent\n",
- i, j, PLA->label[ipart], PLA->label[jpart]);
- some_equiv = TRUE;
- } else if (check_equiv(F[i], R[j])) {
- printf("# Outputs %d and NOT %d (%s and %s) are equivalent\n",
- i, j, PLA->label[ipart], PLA->label[jpart]);
- some_equiv = TRUE;
- } else if (check_equiv(R[i], F[j])) {
- printf("# Outputs NOT %d and %d (%s and %s) are equivalent\n",
- i, j, PLA->label[ipart], PLA->label[jpart]);
- some_equiv = TRUE;
- } else if (check_equiv(R[i], R[j])) {
- printf("# Outputs NOT %d and NOT %d (%s and %s) are equivalent\n",
- i, j, PLA->label[ipart], PLA->label[jpart]);
- some_equiv = TRUE;
- }
- }
- }
-
- if (! some_equiv) {
- printf("# No outputs are equivalent\n");
- }
-
- for(i = 0; i < cube.part_size[cube.output]; i++) {
- free_cover(F[i]);
- free_cover(R[i]);
- }
- FREE(F);
- FREE(R);
-}
-
-
-
-int check_equiv(f1, f2)
-pcover f1, f2;
-{
- register pcube *f1list, *f2list;
- register pcube p, last;
-
- f1list = cube1list(f1);
- foreach_set(f2, last, p) {
- if (! cube_is_covered(f1list, p)) {
- return FALSE;
- }
- }
- free_cubelist(f1list);
-
- f2list = cube1list(f2);
- foreach_set(f1, last, p) {
- if (! cube_is_covered(f2list, p)) {
- return FALSE;
- }
- }
- free_cubelist(f2list);
-
- return TRUE;
-}