simplify # trees: Catalan trees -> Wedderburn–Etherington trees

This commit is contained in:
2021-01-25 10:12:45 +01:00
parent 684c33f156
commit 507988a93b
8 changed files with 203 additions and 76 deletions

16
lceb.c
View File

@@ -20,11 +20,18 @@ int main(ac, av)
char **av;
{
unsigned target;
STACK inputstack, *stack;
STACK inputstack = {
"initial",
MAXINPUT, /* size */
0, /* last */
NULL, /* next */
{0}
};
STACK *stack;
int i, j, k, stacksize, val;
int ncombs, nstacks, ntrees, nops;
TREE *tree;
int intarray[1024];
char intarray[1024];
int eval;
char *comb;
struct timespec end;
@@ -47,7 +54,7 @@ int main(ac, av)
set_target(target);
//printf("len_ops=%d\nnops=%d\nops_comb=%d\n", len_ops, nops, ncombs);
//stack=new_stack(stacksize, "Main Stack", 1);
strcpy(inputstack.name, "initial");
//strcpy(inputstack.name, "initial");
for (i=2; i<ac; ++i) {
val=atoi(av[i]);
push_stack(&inputstack, val);
@@ -66,7 +73,8 @@ int main(ac, av)
} while (permute_stack(stack->stack, stack->last));
*/
gen_tree(intarray, nops, 0, 0);
//gen_tree(intarray, nops, 0, 0);
gen_reduced_trees(nops+1);
nstacks=n_stacks();
ntrees=n_trees();
printf("stacks=%d\noperators combinations=%d\ntrees=%d\n",