예제 #1
0
파일: bar.c 프로젝트: AaronNGray/strategoxt
ATerm bar_1_0(StrSL sl, StrCL s, ATerm t)
{
  ATfprintf(stderr, "bar_1_0(%t)\n", t);
  t = cl_fun(s)(cl_sl(s),t);
  t = (ATerm)ATmakeAppl2(sym__2, term_p_0, t);
  return(t);
}
예제 #2
0
파일: absint.c 프로젝트: jkeiren/muCRL
ATerm createMustSum(ATerm sum){	
	ATerm cond, newCond, condSort, act, newAct, newSum;
	char newActName[250];
	AFun memberTag; 
	ATbool toAbs = ATfalse;
	
	memberTag = createNewFuncSym(memberSym, 
			ATmakeList2(MCRLterm_bool, liftSort(MCRLterm_bool)));
	
	cond = (ATerm) ATgetArgument((ATermAppl) sum ,4);	
	condSort = getTermSort(cond);
	
	if(isLifted(condSort)) toAbs = ATtrue;
	
	if(isAbstracted(condSort))
		cond = createGammaTerm(cond, condSort);
		
	if(toAbs){	
		newCond = (ATerm) ATmakeAppl1(MCRLsym_not,
			(ATerm) ATmakeAppl2(memberTag, MCRLterm_false, cond));
	}
	else{
		newCond = cond;
		newSum = sum;
	}
	newSum = (ATerm) ATsetArgument((ATermAppl) sum, (ATerm) newCond, 4);
	act = (ATerm) ATgetArgument((ATermAppl) sum, 1);
	appendString(MCRLgetName(act), mustSufix, newActName);
	newAct = (ATerm) ATmakeAppl0(ATmakeAFun(newActName, 0, ATtrue));
	return (ATerm) ATsetArgument((ATermAppl) newSum, newAct, 1);
}
예제 #3
0
파일: absint.c 프로젝트: jkeiren/muCRL
ATerm createMemberAuxCondition(ATerm cond, ATerm var, 
					ATerm arg, ATerm varSort){
	AFun memberTag, andTag;
	
	memberTag = createNewFuncSym(memberSym, 
			ATmakeList2(varSort, liftSort(varSort)));
	
	andTag = createNewFuncSym(andSym, 
			ATmakeList2(MCRLterm_bool, MCRLterm_bool));
			
	if(cond == NULL){
		cond = (ATerm) ATmakeAppl2(memberTag, var, arg);
	} 
	else{
		cond = (ATerm) ATmakeAppl2(andTag, cond, 
							(ATerm) ATmakeAppl2(memberTag, var, arg));
	}
	return cond;
}
예제 #4
0
파일: absint.c 프로젝트: jkeiren/muCRL
ATerm addVar(ATerm sum, ATerm varName, ATerm varSort){
	ATermList vars = ATmakeList0();
	ATerm var;
	AFun vTag  = ATmakeSymbol("v",2, ATfalse); 
	
	vars = (ATermList) ATgetArgument((ATermAppl) sum ,0);
	vars = ATinsert(vars,(ATerm)ATmakeAppl2(vTag,varName,varSort));
	
	return (ATerm) ATsetArgument((ATermAppl) sum, (ATerm) vars, 0);
}
예제 #5
0
파일: absint.c 프로젝트: jkeiren/muCRL
ATerm createSingleton(ATerm value, ATerm sort){
	ATerm setSort;
	AFun inFun; 
	ATerm emptyTerm;
	
	setSort = liftSort(sort);
	inFun = createInCons(sort, setSort);
	emptyTerm = createEmptyCons(setSort);
	
	return (ATerm) ATmakeAppl2(inFun, value, emptyTerm);
}
예제 #6
0
파일: absint.c 프로젝트: jkeiren/muCRL
ATerm createAuxCondition2(ATerm auxCond, ATerm cond){
	AFun andTag;
	andTag = createNewFuncSym(andSym, 
			ATmakeList2(MCRLterm_bool, MCRLterm_bool));
	
	if(auxCond != NULL){
		cond = (ATerm) ATmakeAppl2(andTag, cond, 
							auxCond);
	} 
	return cond;
}
예제 #7
0
파일: absint.c 프로젝트: jkeiren/muCRL
ATerm createSingletonAuxCondition(ATerm cond, ATerm func, ATerm fSort){
	AFun singletonTag, andTag;
	andTag = createNewFuncSym(andSym, 
			ATmakeList2(MCRLterm_bool, MCRLterm_bool));
	
	singletonTag = createNewFuncSym(singletonSym, 
		ATmakeList1(fSort));	
			
	if(cond == NULL){
		cond = (ATerm) ATmakeAppl1(singletonTag, func);
	} 
	else{
		cond = (ATerm) ATmakeAppl2(andTag, cond, 
							(ATerm) ATmakeAppl1(singletonTag, func));
	}
	return cond;
}
예제 #8
0
파일: absint.c 프로젝트: jkeiren/muCRL
void initAbsInt(){
	ATbool ok;
	AFun memberTag;	

	initTables();	
	
	conflictingPars = ATmakeList0();

	ATprotect((ATerm *)&conflictingPars);
	
	memberTag = createNewFuncSym(memberSym, 
			ATmakeList2(MCRLterm_bool, liftSort(MCRLterm_bool)));
	
	MCRLputMap((ATerm)ATmakeAppl2(memberTag, 
				MCRLterm_bool, liftSort(MCRLterm_bool)), 
			MCRLterm_bool, &ok);	
}
예제 #9
0
파일: rewr.c 프로젝트: jkeiren/muCRL
static ATerm _ProveCondition(ATerm c) {
       /* Obliged that last branch must be "if (b, T, F)" 
       Invariant will be used at each first argument of "if" */
      ATerm result = c;
      ATermList ts = ATempty;
      while (ATgetAFun(c)==MCRLsym_ite && 
           ATgetArgument((ATermAppl) c, 2) == MCRLterm_false) {
          ts = ATinsert(ts, ATgetArgument((ATermAppl) c, 0));
          c = ATgetArgument((ATermAppl) c, 1);
          }
     if (ATisEmpty(ts)) return result;
     else {
         int n = ATgetLength (ts), i;
         DECLA(ATerm, l, n);DECLA(ATerm, r, n); DECLA(ATerm, s, n);
         ATerm I = MCRLgetInvariant(0);
         for (i=n-1;i>=0;i--, ts = ATgetNext(ts)) 
            l[i] = ATgetFirst(ts);
         for (i=0;i<n;i++) {
            int j, p; 
            for (p = 0, j=n-1;j>=0;j--) 
            if (i!=j) {
                s[p] = 
                   (ATerm) ATmakeAppl3(MCRLsym_ite, l[j], 
                   p>0?s[p-1]:MCRLterm_true,MCRLterm_false);
                   p++;
                }
            r[i] = p>0?s[p-1]:MCRLterm_true;  
         }
         for (i=0;i<n;i++) {
     /* If proven (I and r) -> l  then (c = l and r) will be replaced by r */
            ATerm IandR = (ATerm) ATmakeAppl2(MCRLsym_and, I, r[i]),
            arrow = Prove((ATerm) ATmakeAppl3(MCRLsym_ite, IandR, l[i], 
                 MCRLterm_true));
            /* ATwarning("QQQA %t", MCRLprint(arrow)); */
            if (ATisEqual(arrow, MCRLterm_true)) {
                 return r[i];
                 } 
            }
      return result;
      }
    }
예제 #10
0
ATTuple ATR_makeTuple(ATerm aterm1, ATerm aterm2) {
  return (ATTuple)ATmakeAppl2(ATmakeAFun("", 2, ATfalse), aterm1, aterm2);
}