datatype list = nill | cons of int * list fun f( Xs : list ) : list = raise D1 fun main( Xs : list ) : list = f Xs %% fun to_list [] = nill | to_list( X :: Xs ) = cons( X, to_list Xs ) fun from_list nill = [] | from_list( cons( X, Xs ) ) = X :: from_list Xs val Input_output_pairs = [ ( [], [] ), ( [7], [7] ), ( [5,6], [5,6] ), ( [1,0], [0,1] ), ( [0,1,2], [0,1,2] ), ( [0,2,1], [0,1,2] ), ( [1,0,2], [0,1,2] ), ( [1,2,0], [0,1,2] ), ( [2,0,1], [0,1,2] ), ( [2,1,0], [0,1,2] ), ( [1,0,2,3], [0,1,2,3] ), ( [2,1,0,4,3], [0,1,2,3,4] ), ( [2,5,1,0,4,3], [0,1,2,3,4,5] ), ( [5,2,1,4,3,0], [0,1,2,3,4,5] ), ( [9,2,5,1,0,7,8,3,4,6], [0,1,2,3,4,5,6,7,8,9] ) ] val Validation_inouts = [ ( [2,1,3,0,5,4], [0,1,2,3,4,5] ), ( [7,2,1,3,8,0,5,4,9,6], [0,1,2,3,4,5,6,7,8,9] ) ] val Inputs = map( to_list o #1, Input_output_pairs ) val Validation_inputs = map( to_list o #1, Validation_inouts ) val Outputs = Vector.fromList( map( to_list o #2, Input_output_pairs @ Validation_inouts ) ) val Abstract_types = [] val Funs_to_use = [ "false", "true", "<", "nill", "cons" ] val Reject_funs = [] fun restore_transform D = D structure Grade : GRADE = struct type grade = unit val zero = () val op+ = fn(_,_) => () val comparisons = [ fn _ => EQUAL ] val toString = fn _ => "" val fromString = fn _ => SOME() val pack = fn _ => "" val unpack = fn _ =>() val post_process = fn _ => () val toRealOpt = NONE end fun output_eval_fun( I : int, _ : list, Y : list ) = if Vector.sub( Outputs, I ) = Y then { numCorrect = 1, numWrong = 0, grade = () } else { numCorrect = 0, numWrong = 1, grade = () } val Max_output_genus_card = 2 val Max_time_limit = 262144 val Time_limit_base = 2.0