WARNING: Compilation error, verify your source file

"; die("Please click 'back' on your browser."); } } function show_methods($list,$context,$file_name) { $acm=substr_count($list,'main([Ljava/lang/String;)V'); $acm_cmd=substr_count($list,'commandAction(Ljavax/microedition/lcdui/Command;Ljavax/microedition/lcdui/Displayable;)V'); if(substr_count($list,',')>0) { $method_signature=explode(',',$list); }else { $method_signature=explode(" ",$list); } $limit=count($method_signature); if ($limit>1) { $limit=$limit-1; } if ($acm == 1 || $acm_cmd == 1) { // there is a main or cmdAction for($i=0; $i < $limit; $i ++) { // bubble if(substr_count($method_signature[$i],'main([Ljava/lang/String;)V')==1 || substr_count($method_signature[$i],'commandAction(Ljavax/microedition/lcdui/Command;Ljavax/microedition/lcdui/Displayable;)V')==1) { $aux=$method_signature[0]; $method_signature[0]=$method_signature[$i]; $method_signature[$i]=$aux; } } if (substr_count($file_name,'x10') != 1){ ?> or Select All "; } echo "
"; for($i=0; $i < $limit; $i ++) { $method_sign=htmlentities($method_signature[$i]); if($i==0) { //if(substr_count($method_sign,'main([Ljava/lang/String;)V')==1 || substr_count($method_sign,'commandAction(Ljavax/microedition/lcdui/Command;Ljavax/microedition/lcdui/Displayable;)V')==1){ //echo " $method_signature[$i]"."
"; echo " $method_signature[$i]"."
"; } else { echo " $method_signature[$i] "."
"; } } if($context!="") { $size=strlen($context); echo "
Context Info (Classes)
"; } // else { // echo "
Context Info (Classes)
"; // } }else { // not main if (substr_count($file_name,'x10') != 1){ ?> or Select All "; } echo "
"; for($i=0; $i < $limit; $i ++) { $method_sign=htmlentities($method_signature[$i]); if($i==0) { // echo " $method_signature[$i] "."
"; echo " $method_signature[$i] "."
"; }else { // echo " $method_signature[$i] "."
"; echo " $method_signature[$i]"."
"; } } if($context!="") { $size=strlen($context); echo "
Context Info (Classes)
"; } // else { // echo "
Context Info (Classes)
"; // } } } //function parse_dot_seetings($examples,$filename){ function parse_dot_seetings($path,$filename) { $define_settings=array('-m','-c','cost_model','-u','compute_asymptotic_ub','gc_model','-p'); $flags=array(); $values_settings=array(); //$path_to_settings_file=$examples."/".$filename.".settings"; $path_to_settings_file=$path."/".$filename.".settings"; if (file_exists($path_to_settings_file)) { $values=file_get_contents($path_to_settings_file); $settings=explode(PHP_EOL,chop($values)); for($i=0;$i',$file_contents);// for($j=0; $j until //for ($i=0; $i=1){ /// looking if the flag exsits in option
  • if(substr_count($each_option_web[$j],$flags[$i])>=1) { /// looking if the flag exsits in option
  • $eachline_opt=explode(' $restline[0]=array_pop($new_value); ///
    } $tmp[0]= implode(" ",$new_value); array_splice($eachline_opt, 1,1, $tmp); $tmp[1]=implode(" ",$old_default); array_splice($eachline_opt, $pos,1, $tmp); array_splice($eachline_opt, $pos,1); } //if($i<=count($values_flags)){$each_option_web[$j]=implode('", $each_option_web); $remove1=str_replace('
  • ', '', $implode); $remove2=str_replace('', '', $remove2); $remove4=str_replace('
  • ', '', $remove3); $remove5=str_replace('', '', $remove4); $remove6=str_replace(' > ',' > ',$remove5); echo $remove6; echo ""; } ?> COSt Termination Analyzer for Java Bytecode
    COSTA: COSt and Termination Analyzer for Java Bytecode
        
        package x10;
    
    
    //import java.util.Random;
    
    
    public class CUDABlackScholes {
    
        static void doBlackScholes(//float optionYears[],
    			       //float stockPrice[],
    			       //float optionStrike[],
    			       //float callResult[],
    			       //float putResult[],
    			       //float R,
    			       //float V,
    			       int opt_N
    			       ) {
            int blocks = 480;
            int threads = 128;
    	Conc.finish_begin();
    	doBlackScholes_mainLoop(/*optionYears,stockPrice,optionStrike,callResult,putResult,R,V,*/opt_N,blocks,threads);
    	Conc.finish_end();
        }
        
        
        static void doBlackScholes_mainLoop(//float optionYears[],
    					//float stockPrice[],
    					//float optionStrike[],
    					//float callResult[],
    					//float putResult[],
    					//float R, 
    					//float V,
    					int opt_N,
    					int blocks,
    					int threads) {
    	Conc.async_begin();
    	doBlackScholes_mainLoop_1(/*optionYears,stockPrice,optionStrike,callResult,putResult,R,V,*/opt_N,blocks,threads);
    	Conc.async_end();
        }
        
        
        static void doBlackScholes_mainLoop_1(//float optionYears[],
    					  //float stockPrice[],
    					  //float optionStrike[],
    					  //float callResult[],
    					  //float putResult[],
    					  //float R,
    					  //float V,
    					  int opt_N,
    					  int blocks,
    					  int threads) {
    
    	for (int block=0; block<blocks; block++) {
    	    for (int thread=0; thread<threads; thread++) {
    		Conc.async_begin();
    		doBlackScholes_innerLoop(/*optionYears,stockPrice,optionStrike,callResult,putResult,R,V,*/opt_N,blocks,threads,block,thread);
    		Conc.async_end();
    	    }
    	}
        }
    
    
        static void doBlackScholes_innerLoop(//float optionYears[],
    					 //float stockPrice[],
    					 //float optionStrike[],
    					 //float callResult[],
    					 //float putResult[],
    					 //float R,
    					 //float V,
    					 int opt_N,
    					 int blocks,
    					 int threads,
    					 int block,
    					 int thread) {
    	//int tid = block * threads + thread;
    	//int tids = blocks * threads;
    	//for (int opt=tid; opt<opt_N; opt+=tids) {
    	    //float A1 = 0.31938153f;
    	    //float A2 = -0.356563782f;
    	    //float A3 = 1.781477937f;
    	    //float A4 = -1.821255978f;
    	    //float A5 = 1.330274429f;
    	    //float RSQRT2PI = 0.39894228040143267793994605993438f;
    	    
    	    //float T = optionYears[opt];
    	    //float S = stockPrice[opt];
    	    //float X = optionStrike[opt];
    	    //float sqrtT = (float) Math.sqrt(T);
    	    //float d1 = ((float) Math.log(S/X) + (R + 0.5f * V * V) * T) / (V * sqrtT); 
    	    //float d2 = d1 - V * sqrtT;
    	    
    	    //float K1 = 1.0f / (1.0f + 0.2316419f * Math.abs(d1));
    	    //float K2 = 1.0f / (1.0f + 0.2316419f * Math.abs(d2));
    	    //float CNDD1 = RSQRT2PI * (float) Math.exp(- 0.5f * d1 * d1) * 
    	    //	(K1 * (A1 + K1 * (A2 + K1 * (A3 + K1 * (A4 + K1 * A5)))));
    	    //float CNDD2 = RSQRT2PI * (float) Math.exp(- 0.5f * d2 * d2) * 
    	    //	(K2 * (A1 + K2 * (A2 + K2 * (A3 + K2 * (A4 + K2 * A5)))));
    	    
    	    //if (d1 > 0) CNDD1 = 1.0f - CNDD1;
    	    //if (d2 > 0) CNDD2 = 1.0f - CNDD2;
    	    
    	    //float expRT = (float) Math.exp(- R * T); 
    	    //callResult[opt] = S * CNDD1 - X * expRT * CNDD2;
    	    //putResult[opt]  = X * expRT * (1.0f - CNDD2) - S * (1.0f - CNDD1); 
    	//}
        }
    
    
        public static void main(String args[]) {
    
            // Problem parameters
            int OPT_N = 4000000;
            int NUM_ITERATIONS = args.length;//512;
            //float RISKFREE = 0.02f;
            //float VOLATILITY = 0.30f;
    
            //Random rand = new Random();
    
            //float h_CallResultCPU[] = {};
            //float h_PutResultCPU[] = {};
            //float h_CallResultGPU[] = {};
            //float h_PutResultGPU[] = {};
            //float h_StockPrice[] = {};
            //float h_OptionStrike[] = {};
            //float h_OptionYears[] = {};
    
            //float d_CallResult[] = {};
            //float d_PutResult[] = {};
            //float d_StockPrice[] = {};
            //float d_OptionStrike[] = {};
            //float d_OptionYears[] = {};
    
    	// array initializing (is OPT_N the length?)
    	//for(int i=0; i<OPT_N; i++) {
    	//    h_CallResultCPU[i] = 0;
    	//    h_PutResultCPU[i] = -1;
    	//    h_CallResultGPU[i] = 0;
    	//    h_PutResultGPU[i] = 0;
    	//    h_StockPrice[i] = rand.nextFloat();
    	//    h_OptionStrike[i] = rand.nextFloat();
    	//    h_OptionYears[i] = rand.nextFloat();
    
    	//    d_CallResult[i] = 0;
    	//    d_PutResult[i] = 0;
    	//    d_StockPrice[i] = h_StockPrice[i];
    	//    d_OptionStrike[i] = h_OptionStrike[i];
    	//    d_OptionYears[i] = h_OptionYears[i];
    	//}
    
            for (int i=0; i<NUM_ITERATIONS; i++) {
                doBlackScholes(/*d_OptionYears,d_StockPrice,d_OptionStrike,d_CallResult,d_PutResult,RISKFREE,VOLATILITY*/OPT_N);
            }
    
    	// here, for simplicity, two calls in a finish have been replaced by two finish calls
    	Conc.finish_begin();
    	copyArray(/*d_CallResult,h_CallResultGPU,*/0,OPT_N);
    	Conc.finish_end();
    	Conc.finish_begin();
    	copyArray(/*d_PutResult,h_PutResultGPU,*/0,OPT_N);
    	Conc.finish_end();
    
            doBlackScholes(/*h_OptionYears,h_StockPrice,h_OptionStrike,h_CallResultCPU,h_PutResultCPU,RISKFREE,VOLATILITY*/OPT_N);
            //float sum_delta = 0.0f;
            //float sum_ref = 0.0f;
            //float max_delta = 0.0f;
            //for (int i=0; i<OPT_N; i++) {
    	//float ref_val = h_CallResultCPU[i];
            //    float delta = Math.abs(ref_val - h_CallResultGPU[i]);
            //    if (delta > max_delta) max_delta = delta;
            //    sum_delta += delta;
            //    sum_ref   += Math.abs(ref_val);
            //}
            //float L1norm = sum_delta / sum_ref;
        }
    
    
        public static void copyArray(//float source[],
    				 //float target[],
    				 int from,
    				 int to) {
    	//for (int i=from; i<to; i++) target[i] = source[i];
        }
    
    
    
    }