# https://www.facebook.com/Heavydsparks/photos/a.1432147377066939/2976473412634320/
#
# 9 = 90
# 8 = 72
# 7 = 56
# 6 = 42
# 3 = ?
#
# There are at least two logical solutions:
#   18 or 12
# depending on if you multiply 3 with 4 (12) or 6 (18).
#
# In facebook_puzzle2.conf, the "natural" solution was 12.
#
# This is a different encoding that includes the previous
# row for trying to get the 18 formula.
# 
# Note that the first equation become
#   10 1 9 90
# which might be considered cheating.
#
# Some solutions, some of them found by forcing the solutions (see below).
#
# * c * a
#   6.0 42.0 3.0    Result: 18.0
#
# * c + (c * c)
#   6.0 42.0 3.0    Result: 12.0
#
# * (c * a) - ((c * c) - ((c * a) - c))
#   6.0 42.0 3.0    Result: 24.0
#
# * (a * c) / (a - c)
#   6.0 42.0 3.0    Result: 6.0
# 
# * c + (((c * a) - c) / (a - c))
#   6.0 42.0 3.0    Result: 8.0
#
# * (a * c) * (a - c)
#   6.0 42.0 3.0    Result: 54.0
# 
presentation: Puzzle
# return_type:IntegerClass
num_input_variables: 3
output_variable:3
variable_names: a b c d
functions: Multiply,Divide,Subtract,Add

# functions: Add,Multiply
# functions: Add,Pow
# functions: ForLoopD
# functions: Add,ForLoopD
# functions: Add,ForXLoop,SubProgram
# functions: Add,LoopD
# functions: Multiply,Divide,Add,Subtract,Modulo,GreaterThan,LesserThan,IfElse,If,Equals,And,Or,Not,Xor
# functions: Add,Modulo,SubProgram,Tupel,Argument,StoreTerminal
# functions: Add,Modulo
# functions: Add,Multiply,SubProgram,Tupel,Argument,StoreTerminal
# functions: Multiply,Divide,Subtract,Modulo,GreaterThan,LesserThan,IfElse,If,Equals,ForXLoop,Increment,ForLoop,Loop,Pop,Push,And,Or,Not,Xor,SubProgram,Tupel,Argument,StoreTerminal
# functions: Multiply,Divide,Add,Subtract,LoopD
# functions: Add,ForXLoop,ForLoop,Loop,SubProgram,Tupel,Argument,StoreTerminal
# functions: Add,GreaterThan,LesserThan,IfElse,If,Equals,ForXLoop,Increment,ForLoop,Loop,Pop,Push,And,Or,Not,Xor,SubProgram,Tupel,Argument,StoreTerminal
# adf_arity: 3
# adf_type: integer
# adf_functions: Multiply,Add
# adf_functions: IfElse,If,Equals,ForXLoop,Increment,ForLoop,Loop,Pop,Push,And,Or,Not,Xor,SubProgram,Tupel,Argument,StoreTerminal
terminal_range: 0 100
terminal_wholenumbers: true
# max_init_depth: 4
max_init_depth: 8
population_size: 100
max_crossover_depth: 8
num_evolutions: 1000
# max_nodes: 51
max_nodes: 21
mutation_prob: 0.15
crossover_prob: 0.9
# crossover_prob: 0.96
show_similiar: true
# show_population: true
show_results: true
stop_criteria_fitness: 0
data
# Note: Implicit 10 1 on the first equation
10  1 9 90
 9 90 8 72
 8 72 7 56
 7 56 6 42
 6 42 3 ?

# Force the 18 solution
# 6 42 3 18
# Force the 12 solution
# 6 42 3 12
# Force the 24 solution
# 6 42 3 24

# Force a 6 solution
# 6 42 3 6

# Force a 8 solution
# 6 42 3 8