-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
ad7e132
commit fbf020f
Showing
15 changed files
with
142 additions
and
184 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,28 @@ | ||
import Math; | ||
import PSB2; | ||
import extract_train_data from PSB2; | ||
import get_input_list from PSB2; | ||
import get_output_list from PSB2; | ||
import calculate_list_errors from PSB2; | ||
import get_dg_synth_values from PSB2; | ||
import unpack_train_data from PSB2; | ||
import load_dataset from PSB2; | ||
|
||
|
||
@ignore() | ||
def train: TrainData = extract_train_data (load_dataset "dice-game" 200 200); | ||
|
||
@ignore() | ||
def input_list : List = get_input_list (unpack_train_data train); | ||
|
||
@ignore() | ||
def expected_values : List = get_output_list (unpack_train_data train); | ||
|
||
@syn_ignore(extract_train_data, | ||
get_input_list, | ||
get_output_list, | ||
unpack_train_data, | ||
load_dataset, | ||
get_dg_synth_values, | ||
calculate_list_errors) | ||
@multi_minimize_float(calculate_list_errors (get_dg_synth_values input_list synth)(expected_values)) | ||
def synth ( n : {a:Int | 1 <= a && a <= 10000} , m : {b:Int | 1 <= b && b <= 10000}) : Float | ||
def synth (n: Int, m: Int) : Float | ||
{ | ||
(?hole:Float) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 15 additions & 25 deletions
40
examples/PSB2/annotations/multi_objective/square_digits.ae
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,24 @@ | ||
# Given a positive integer, square each digit and | ||
# concatenate the squares into a returned string. | ||
# input : integer in [0, 1000000] | ||
# output : string | ||
import String; | ||
import Math; | ||
import PSB2; | ||
|
||
#def square_digit ( n :{x:Int | 0 <= x && x <= 1000000}) : String { | ||
# if n == 0 then | ||
# "" | ||
# else | ||
# digit = n % 10; | ||
# square = digit * digit; | ||
# result = String_concat (square_digit(Math_floor_division n 10)) (String_intToString(square)); | ||
# result | ||
#} | ||
|
||
def square_digit_unsafe ( n : Int) : String { | ||
if n == 0 then | ||
"" | ||
else | ||
digit = n % 10; | ||
square = digit * digit; | ||
result = String_concat (square_digit_unsafe(Math_floor_division n 10)) (String_intToString(square)); | ||
result | ||
} | ||
import extract_train_data from PSB2; | ||
import get_input_list from PSB2; | ||
import get_output_list from PSB2; | ||
import calculate_list_errors from PSB2; | ||
import get_sd_synth_values from PSB2; | ||
import unpack_train_data from PSB2; | ||
import load_dataset from PSB2; | ||
import calculate_str_list_errors from PSB2; | ||
|
||
def train: TrainData = extract_train_data (load_dataset "square-digits" 200 200); | ||
def input_list : List = get_input_list (unpack_train_data train); | ||
def expected_values : List = get_output_list (unpack_train_data train); | ||
|
||
@syn_ignore(extract_train_data, | ||
get_input_list, | ||
get_output_list, | ||
unpack_train_data, | ||
load_dataset, | ||
get_sd_synth_values, | ||
calculate_list_errors) | ||
@multi_minimize_float(calculate_str_list_errors (get_sd_synth_values input_list synth) (expected_values)) | ||
def synth ( n : Int) : String {(?hole:String)} |
21 changes: 15 additions & 6 deletions
21
examples/PSB2/annotations/single_objective/bouncing_balls.ae
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,28 @@ | ||
import Math; | ||
import PSB2; | ||
#def mult ( n:Int , m:Int ) : Int { n * m } | ||
import extract_train_data from PSB2; | ||
import get_input_list from PSB2; | ||
import get_output_list from PSB2; | ||
import calculate_list_errors from PSB2; | ||
import get_dg_synth_values from PSB2; | ||
import unpack_train_data from PSB2; | ||
import load_dataset from PSB2; | ||
import mean_absolute_error from PSB2; | ||
|
||
#def peter_wins: ( n:Int ) -> ( m:Int ) -> Int = \n -> \m-> if m == 0 then 0 else (Math_max 0 (n - m)) + peter_wins n (m - 1); | ||
|
||
#def dice_game ( n : {x:Int | 1 <= x && x <= 10000} , m : {y:Int | 1 <= y && y <= 10000}) : Float { | ||
# Math_toFloat(peter_wins n m ) /. Math_toFloat(mult n m) } | ||
|
||
@ignore() | ||
def train: TrainData = extract_train_data ( load_dataset "dice-game" 200 200); | ||
|
||
@ignore() | ||
def input_list : List = get_input_list ( unpack_train_data train); | ||
|
||
@ignore() | ||
def expected_values : List = get_output_list ( unpack_train_data train); | ||
|
||
@syn_ignore(extract_train_data, | ||
get_input_list, | ||
get_output_list, | ||
unpack_train_data, | ||
load_dataset, | ||
get_dg_synth_values, | ||
calculate_list_errors) | ||
@minimize_float(mean_absolute_error (get_dg_synth_values input_list synth)(expected_values)) | ||
def synth ( n : {a:Int | 1 <= a && a <= 10000} , m : {b:Int | 1 <= b && b <= 10000}) : Float | ||
def synth (n: Int , m: Int) : Float | ||
{ | ||
(?hole:Float) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.