# Re: [csmith-dev] Random configuration file for csmith

On Thu, May 12, 2011 at 6:20 PM, Yang Chen wrote:
On 5/12/11 4:01 AM, haihao shen wrote:
Thanks Yang.

I have another question on group configuration. As described in doc/probabilities.txt (e.g., statement_prob), seems there is 15% chance to get statement_ifelse (55%-40%).

It's an example and might not reflect the current configuration in Csmith.

[Haihao] Thanks. I see.

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 (15-0)% = 15% change to generate if-else statements, (35-15)% = 20% chance to generate return statements, etc.

[Haihao]  Next is 40-35? 45-40? 50-45?

[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 ;)

Also, what is the difference between [statement_prob,...] and (assign_binary_ops_prob,...)? Does the latter have the same rule as the former?

No. They are different. The latter means that the individual probabilities are evenly distributed. For example,

means that we have 25% chance to generate "+", 25% chance to generate "-", etc.

[Haihao] I see. Thanks.

- Yang

Thanks,
Haihao

On Thu, May 12, 2011 at 5:50 PM, Yang Chen wrote:
Hi Haihao,

On 5/12/11 3:41 AM, haihao shen wrote:
Hi,

csmith provided the interface to take configure file as input to generate different kinds of test cases. However, there is lack of documentation to describe how to set the value of configure parameter.

doc/probabilities.txt describes the format of probability configurations.

For example, I don't know whether different items in configure file have dependencies. I don't know whether all the values could range from 0 to 100.

I am wondering whether there is any empirical data for random configuration.

Sorry, we don't have that data.

- Yang

Thanks,
Haihao