From 7c34522d9f9b3bc6836ec86fc86d716b1cdf943f Mon Sep 17 00:00:00 2001 From: Nicolas Chataing Date: Tue, 26 May 2020 10:12:58 +0200 Subject: [PATCH] add better default logic representation to the lambda calculus --- src/catala/ir/lambda.ml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/catala/ir/lambda.ml b/src/catala/ir/lambda.ml index 33003adc..b3204661 100644 --- a/src/catala/ir/lambda.ml +++ b/src/catala/ir/lambda.ml @@ -71,6 +71,17 @@ type 'expr program = { fields : 'expr field Ir.ScopeMap.t; } -type program_with_default_logic = term list program - type program_with_normal_logic = term program + +module IntMap = Map.Make (Int) + +type precondition = term + +type consequence = term + +type default_term = { + defaults : (precondition * consequence) IntMap.t; + ordering : (int * int) list; +} + +type program_with_default_logic = default_term program