2 * Copyright (c) 2016, Facebook, Inc.
5 * This source code is licensed under the MIT license found in the
6 * LICENSE file in the "hack" directory of this source tree.
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
26 let long_assignment_config =
28 ("SimpleAssignmentExpression", [0.6; 0.2; 0.2]);
29 ("CompoundAssignmentExpression", [0.6; 0.2; 0.2]);
33 [("Default", default); ("LongAssignmentConfig", long_assignment_config)]
35 let find_config name
= List.assoc name
mapping