On 5/12/11 4:47 AM, haihao shen wrote:
You mean the items should be sorted from small to large
and then measure the prob via latter minus former, right?
The output probabilities are not sorted, but the Csmith will treat them
in order. For example, Csmith internally converts
[statement_prob,statement_assign_prob=100,statement_block_prob=0,statement_for_prob=30,statement_ifelse_prob=15,
statement_return_prob=35,statement_continue_prob=40,statement_break_prob=45,statement_goto_prob=50,
statement_arrayop_prob=60]
to
[statement_prob, statement_block_prob=0, statement_ifelse_prob=15,
statement_for_prob=30,
statement_return_prob=35,statement_continue_prob=40,statement_break_prob=45,
statement_goto_prob=50,statement_arrayop_prob=60,statement_assign_prob=100]
As I said, we might need to generate the sorted probabilities as well,
to avoid confusing.
Is there any underlying assumption to measure the prob?
Somehow we choose those probabilities heuristically. We don't have
clear idea about the relation between probability distributions and the
bug finding power of Csmith.
Why minus?
It's just a design choice. We set 0 as "don't generate it". For
example,
statement_block_prob=0,
Then, say we need to choose a value to represent the probability to
generate ifelse statements. But how can we represent it? You can read
the graph below:
[014] [1529] [3034]
block ifelse for
...
I have a simple idea, just for each item randomly choosing
from 0 to 100. Is it OK?
You can do that. But if you really want some random probability
distributions, you can try randomrandom option, which automatically
gives you random probabilities.
 Yang
Thanks,
Haihao
On Thu, May 12, 2011 at 6:43 PM, Yang Chen <chenyang@cs.utah.edu>
wrote:
On 5/12/11 4:34 AM, haihao shen wrote:
[Haihao]
Does
"statement_assign_prob=100" mean the total prob for statement_prob is
100%? Is always the latter one minus the former? How about
"statement_for_prob=30,statement_ifelse_prob=15"? Please explain more ;)
I am sorry I missed it.
The above example means that we have (10060)% chance to get assignment
statements, (150)% to have ifelse statements and (3015)% to for
statements. If the probability value for a statement type is 0, Csmith
won't generate that kind of statements, for example,
"statement_block_prob = 0" means that Csmith is not going to produce
"standalone" block statements (besides those block statements belonging
to ifelse and for).
 Yang
On Thu, May 12, 2011 at 6:33 PM, Yang
Chen <chenyang@cs.utah.edu>
wrote:
On 5/12/11 4:29 AM, haihao shen wrote:
However, in the latest generated
sample
configure file by
csmith, statement_assign_prob=100, statement_block_prob=0. Does it mean
only 100% chance to get statement_block_prob?
No. The probabilities are not sorted in the output (Maybe we should do
that). For example, Here is a sample output:
[statement_prob,statement_assign_prob=100,statement_block_prob=0,statement_for_prob=30,statement_ifelse_prob=15,
statement_return_prob=35,statement_continue_prob=40,statement_break_prob=45,statement_goto_prob=50,
statement_arrayop_prob=60]
It means that we have (150)% = 15% change
to
generate
ifelse
statements, (3515)% = 20% chance to generate return statements, etc.
[Haihao] Next is 4035? 4540? 5045?
Yes :)
(4035)% for continue statements, (4540)% for break statements and
(5045)% for goto statements.
 Yang
