Skip to content

Commit

Permalink
Replaced more examples of the old argument syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
alcides committed Mar 8, 2024
1 parent 6a8ad8f commit 3b0fd94
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def abs (i:Int) : Int {
if i > 0 then i else -i
}
def midpoint(a:Int, b:Int) : Int {
def midpoint (a:In) (b:Int) : Int {
(a + b) / 2
}
Expand Down
6 changes: 3 additions & 3 deletions examples/PSB2/annotations/multi_objective/gcd.ae
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
# output : integer
import PSB2;

def gcd ( n:Int, z:Int) : Int {
if z == 0 then n else (gcd(z)(n % z))
def gcd (n:Int) (z:Int) : Int {
if z == 0 then n else gcd z (n % z)
}

def train: TrainData = extract_train_data (load_dataset "gcd" 200 200);
def input_list : List = get_input_list (unpack_train_data train);
def expected_values : List = get_output_list (unpack_train_data train);

@multi_minimize_float( calculate_list_errors (get_gcd_synth_values input_list synth) (expected_values))
def synth ( n:Int, z:Int) : Int {
def synth (n:Int) (z:Int) : Int {
(?hole:Int)
}
# def largest_common_divisor ( n :{x:Int | 1 <= x && x <= 1000000}, m :{y:Int | 1 <= y && y <= 1000000}) : Int { gcd n m }
4 changes: 2 additions & 2 deletions examples/PSB2/annotations/single_objective/gcd.ae
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# output : integer
import PSB2;

def gcd ( n:Int, z:Int) : Int {
def gcd (n:Int) (z:Int) : Int {
if z == 0 then n else (gcd(z)(n % z))
}

Expand All @@ -13,7 +13,7 @@ def input_list : List = get_input_list ( unpack_train_data train);
def expected_values : List = get_output_list ( unpack_train_data train);

@minimize_float( mean_absolute_error ( get_gcd_synth_values input_list synth) ( expected_values))
def synth ( n:Int, z:Int) : Int {
def synth (n:Int) (z:Int) : Int {
(?hole:Int)
}
# def largest_common_divisor ( n :{x:Int | 1 <= x && x <= 1000000}, m :{y:Int | 1 <= y && y <= 1000000}) : Int { gcd n m }
6 changes: 3 additions & 3 deletions examples/PSB2/non_working/gcd.ae
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
# --not- working - recursion problem--
# RecursionError: maximum recursion depth exceeded in comparison

def gcd ( n:Int, z:Int) : Int {
if z == 0 then n else (gcd(z)(n % z))
def gcd (n:Int) (z:Int) : Int {
if z == 0 then n else gcd z (n % z)
}

def synth_gcd ( n:Int, z:Int) : Int {
def synth_gcd (n:Int) (z:Int) : Int {
(?hole:Int)
}
# def largest_common_divisor ( n :{x:Int | 1 <= x && x <= 1000000}, m :{y:Int | 1 <= y && y <= 1000000}) : Int { gcd n m }
Expand Down

0 comments on commit 3b0fd94

Please sign in to comment.