Cannot infer a particular rule

11 views
Skip to first unread message

Atharwa Adawdakar

unread,
May 11, 2020, 10:12:55 AM5/11/20
to Daikon discuss
Hie,
I am new to daikon, I am trying to experiment with it
I came across the below example

I want to catch the rule that if age is greater than 18 then he is allowed to drive in trace file but somehow it's
not able to capture this rule

Can someone help ?
package DataStructures;
 
import java.util.Arrays;
 
class person
{
String name;
int age;
Boolean allowedToDrive;


person(String a,int b)
{
name=a;
age=b;
allowedToDrive=false;
}

public String toString() 
    { 
        return name + " " + age+" " + allowedToDrive; 
    } 

}

public class sample3 {
 
public static void dummy(int a,boolean c)
{
return;
}

public static person[] xy(person[] arr)
{

for (int i = 0; i < arr.length; i++)
{
if(arr[i].age > 18 )
{
arr[i].allowedToDrive = true;
}
int x=arr[i].age;
boolean b=arr[i].allowedToDrive;
dummy(x,b);
}

return arr;
}

public static void main(String a[])
{
//int[] arr = {40,10,-30,45,39,32};

person[] arr = new person[] {new person("abc",40),
new person("asd",10),new person("erty",15),
new person("po",45),new person("oiu",17),
new person("efr",5),new person("grege",76),
new person("rget",19),new person("rthtr",34),
new person("gfh",34),new person("cxz",17),
new person("efr",64),new person("cxz",14),
new person("fesgr",15),new person("trfeasyt",1),
new person("asdfs",12),new person("sadfs",51),
new person("rsgt",45) };

arr = xy(arr);

System.out.println("===================");
System.out.println("After Proecessing : ");
System.out.println(Arrays.toString(arr));
}
}



Michael Ernst

unread,
May 11, 2020, 10:17:35 AM5/11/20
to daikon-discuss
Please see the Daikon documentation.  It gives valuable information, such as how to investigate problems on your own and how to provide a complete and useful bug report.  In your case, probably the problem is that by default Daikon produces output at procedure entry and exit points.  You would have noticed that if you had examined the .dtrace file.

Mike

--
You received this message because you are subscribed to the Google Groups "Daikon discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to daikon-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/daikon-discuss/15cc62fa-b2f9-46c1-90f9-f56cd66b9605%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages