# 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).

# Some solutions
# * (a * a) + a
# * (a * a) - ((a - a) - ((a * a) / a))   # simplified to a + a^2
#
# I cannot find any other result than 12 using "3 ?"
# See facebook_puzzle2_b.conf for an alternative encoding that give
# 18 (and some other solutions).
# 
presentation: Puzzle
# return_type:IntegerClass
num_input_variables: 1
output_variable:1
variable_names: a x
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
9  90
8  72
7  56
6  42
3  ?

# Forcing the 18 solution. But no luck!
# 3 18