Multiply entities beyond necessity even more (force better build parallelism)
[hiphop-php.git] / hphp / hack / src / parser / random_ast_generator_config.ml
blob5d81bfc42c3fe26fe574ffd48bfcd0a9239ef6de
1 (*
2 * Copyright (c) 2016, Facebook, Inc.
3 * All rights reserved.
5 * This source code is licensed under the MIT license found in the
6 * LICENSE file in the "hack" directory of this source tree.
8 *)
10 (* This file specifies special configuration where the generation of random
11 * program is biased to create the programs of certain properties
13 * Each config is a dictionary mapping a nonterminal to the distribution of the
14 * probabilities of the different production rules from this terminal.
16 * Note: the weight in the distribution should sum up to 1 *)
18 type t = (string * float list) list
20 let exists name config = List.mem_assoc name config
22 let get name config = List.assoc name config
24 let default = []
26 let long_assignment_config =
28 ("SimpleAssignmentExpression", [0.6; 0.2; 0.2]);
29 ("CompoundAssignmentExpression", [0.6; 0.2; 0.2]);
32 let mapping =
33 [("Default", default); ("LongAssignmentConfig", long_assignment_config)]
35 let find_config name = List.assoc name mapping