/******* BENCHMARK GENERATION ******/ fml NAltBox(integer n, prg P, fml A) { integer i; for (i=0;i0) DeletePrg(P); return A; } fml NAltPos(integer n, prg P, fml A) { integer i; for (i=0;i0) DeletePrg(P); return A; } sequent GenerateModalFormulae(sequent QBFS) { sequent modS,litS; fml A,C; integer i; modS=EMPTY_SEQUENT; if (!flag_SSSEnc) for(; QBFS!=EMPTY_SEQUENT; QBFS=QBFS->rest) modS=WithFml(Box(Star(AltPrg(Rel(ONE))),CopyFml(QBFS->first)), modS); else { for(; QBFS!=EMPTY_SEQUENT; QBFS=QBFS->rest) { litS=QBFS->first->subfml; i=1; A=Var(i); while(i<=AltDepth && !FindTwinFml(A,litS,EqualFml) && !FindTwinFml(A,litS,NegateFml)) { i++; DeleteFml(A); A=Var(i); } if (i>AltDepth) { C=False(); DeleteFml(A); } else { if (FindTwinFml(A,litS,EqualFml)) C=Box(AltPrg(Rel(ONE)),A); else C=Box(AltPrg(Rel(ONE)),Not(A)); while(iAltDepth) Alt=True(); else { curr_depth=i; if ( Existential(i)) Alt=Pos(Rel(ONE),True()); else Alt=Pos(Rel(ONE),And(WithFml(Var(i), WithFml(Pos(Inverse(Rel(ONE)),Pos(Rel(ONE),Not(Var(i)))), EMPTY_SEQUENT)))); while(irest) { j=S->first->name; if (Existential(j)) altS=WithFml(NAltBox(AltDepth-j,Rel(ONE),Pos(Rel(ONE),True())), altS); else altS=WithFml(NAltBox(AltDepth-j,Rel(ONE), Pos(Rel(ONE),And(WithFml(Var(j), WithFml(Pos(Inverse(Rel(ONE)), Pos(Rel(ONE),Not(Var(j)))), EMPTY_SEQUENT))))), altS); altS=WithFml(NAltBox(AltDepth-j+1,Rel(ONE), Imp(WithFml(Var(j), WithFml(Box(Star(AltPrg(Rel(ONE))),Var(j)), EMPTY_SEQUENT)))), WithFml(NAltBox(AltDepth-j+1,Rel(ONE), Imp(WithFml(Not(Var(j)), WithFml(Box(Star(AltPrg(Rel(ONE))),Not(Var(j))), EMPTY_SEQUENT)))), altS)); } } DeleteSequent(varS); return altS; } integer FindWorkableDepth(integer depth, integer vars) { integer power,big_power; big_power=0; power=1; while (big_powerbig_power/vars) { fprintf(stderr,"ERROR - Alternation depth too big - ERROR\n"); fprintf(stderr,"Approv Max for these var numbers = %ld\n",big_power/vars); exit(1); } else return depth; }