datatype peano = Z | S of peano datatype plist = nilpl | consp of peano * plist fun f( InVal : plist ) : peano = raise D1 fun main( Xs : plist ) : peano = f Xs %% fun to_plist [] = nilpl | to_plist( X :: Xs ) = consp( X, to_plist Xs ) val Input = [ ( [] ), ( [Z] ), ( [Z,S(Z)] ), ( [S(Z),S(Z)] ), ( [S(Z),S(S(Z))] ), ( [S(Z),S(S(Z)),Z] ), ( [S(Z),S(S(Z)),S(Z)] ), ( [S(Z),S(S(Z)),S(S(Z))] ), ( [S(S(S(Z))),S(S(Z)),S(Z)] ) ] val Inputs = map( to_plist , Input ) val Outputs = [ ( Z ), ( Z ), ( S(Z) ), ( S(S(Z)) ), ( S(S(S(Z))) ), ( S(S(S(Z))) ), ( S(S(S(S(Z)))) ), ( S(S(S(S(S(Z))))) ), ( S(S(S(S(S(S(Z)))))) ) ] val Validation_inputs = [] val Validation_outputs = [] val All_outputs = Vector.fromList( Outputs @ Validation_outputs ) val Funs_to_use = [ "S", "Z", "nilpl", "consp", "true", "false" ] 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 val Abstract_types = [] fun output_eval_fun( I : int, _ , Y ) = if Vector.sub( All_outputs, I ) <> Y then { numCorrect = 0, numWrong = 1, grade = () } else { numCorrect = 1, numWrong = 0, grade = () } val Max_output_class_card = 2 val Max_output_genus_card = 0 val Max_time_limit = 131072 val Time_limit_base = 2.0