From 819ce2d6de1738c5befed3529f92570bf7182743 Mon Sep 17 00:00:00 2001 From: Adrien Vannson Date: Wed, 18 May 2022 16:44:34 +0200 Subject: [PATCH] Petites modifs --- main.ml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/main.ml b/main.ml index d66a948..12ca508 100644 --- a/main.ml +++ b/main.ml @@ -110,12 +110,16 @@ if !computetype_option then ( with e -> ( Printf.printf "Can't read lambda term\n"; raise e - ) + ) in - begin - match (computeType [] lambda_term) with - | Some t -> Printf.printf "The type of %s is %s\n" (string_of_lam lambda_term) (string_of_ty t) - | None -> Printf.printf "λ-term %s cannot be typed ! (Therfore, it has to be either wrong or not closed)\n" (string_of_lam lambda_term) + begin match (computeType [] lambda_term) with + | Some t -> + Printf.printf "The type of %s is %s\n" (string_of_lam lambda_term) (string_of_ty t) + | None -> ( + Printf.printf + "λ-term %s can't be typed! (it is not closed or not typable)\n" + (string_of_lam lambda_term) + ) end; exit 0 );