From 733834a5a7a3442c4beb88e6ea3b27c441faf349 Mon Sep 17 00:00:00 2001 From: elvis Date: Thu, 24 Oct 2024 16:27:21 +0200 Subject: [PATCH] Ariety to arity --- lib/miniFun.ml | 10 +++++----- lib/miniFun.mli | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/miniFun.ml b/lib/miniFun.ml index 4cc388a..fbdc1f5 100644 --- a/lib/miniFun.ml +++ b/lib/miniFun.ml @@ -51,7 +51,7 @@ type memory = { exception AbsentAssignment of string exception WrongType of string exception DivisionByZero of string -exception WrongAriety of string +exception WrongArity of string exception WrongTypeSpecification of string module Utility = Utility;; @@ -88,7 +88,7 @@ let rec evaluate (mem: memory) (command: t_exp) = match (params, values) with (_, []) -> (m, params) | ([], _) -> - raise (WrongAriety ("Function application has arity " ^ + raise (WrongArity ("Function application has arity " ^ (List.length funcClosure.inputList |> string_of_int) ^ ", but was applied to " ^ @@ -377,7 +377,7 @@ let rec evaluate_type (program: t_exp) context = match typef with FunctionType (tin, tout) -> ( if List.length xs != List.length tin then - raise (WrongTypeSpecification "Type specification for function has wrong ariety.") + raise (WrongTypeSpecification "Type specification for function has wrong arity.") else let context1 = List.fold_left2 (fun acc x t -> VariableMap.add x t acc) context xs tin in match (evaluate_type fbody context1 = tout) with @@ -392,7 +392,7 @@ let rec evaluate_type (program: t_exp) context = let rec helper params typeparams = match (params, typeparams) with ([], _) -> typeparams - | (_, []) -> raise (WrongAriety ("Function application has arity " ^ + | (_, []) -> raise (WrongArity ("Function application has arity " ^ (List.length tin |> string_of_int) ^ ", but was applied to " ^ (List.length xs |> string_of_int) ^ @@ -471,7 +471,7 @@ let rec evaluate_type (program: t_exp) context = match typef with FunctionType (tin, tout) -> ( if List.length xs != List.length tin then - raise (WrongAriety "Type specification for function has wrong ariety.") + raise (WrongArity "Type specification for function has wrong arity.") else let context1 = VariableMap.add f typef context in let context2 = List.fold_left2 (fun acc x t -> VariableMap.add x t acc) context1 xs tin in diff --git a/lib/miniFun.mli b/lib/miniFun.mli index eb0fbc5..3ffc761 100644 --- a/lib/miniFun.mli +++ b/lib/miniFun.mli @@ -50,7 +50,7 @@ type memory = { exception AbsentAssignment of string exception WrongType of string exception DivisionByZero of string -exception WrongAriety of string +exception WrongArity of string exception WrongTypeSpecification of string val reduce : t_exp -> int -> int