mirror of
https://github.com/CatalaLang/catala.git
synced 2024-11-08 07:51:43 +03:00
Removed unnecessary extra runtime function
This commit is contained in:
parent
2b0206a5a8
commit
158d49fe86
@ -187,8 +187,6 @@ let duration_to_string (d : duration) : string =
|
||||
let duration_to_years_months_days (d : duration) : int * int * int =
|
||||
CalendarLib.Date.Period.ymd d
|
||||
|
||||
let duration_to_nb_days (d : duration) : int = CalendarLib.Date.Period.nb_days d
|
||||
|
||||
let handle_default :
|
||||
'a. (unit -> 'a) array -> (unit -> bool) -> (unit -> 'a) -> 'a =
|
||||
fun exceptions just cons ->
|
||||
|
@ -129,7 +129,6 @@ val date_of_numbers : int -> int -> int -> date
|
||||
|
||||
val duration_of_numbers : int -> int -> int -> duration
|
||||
val duration_to_years_months_days : duration -> int * int * int
|
||||
val duration_to_nb_days : duration -> int
|
||||
val duration_to_string : duration -> string
|
||||
|
||||
(**{1 Defaults} *)
|
||||
|
@ -377,12 +377,12 @@ let translate_lit (ctx : context) (l : lit) : Expr.expr =
|
||||
1, 1900 *)
|
||||
| LDate d -> Arithmetic.Integer.mk_numeral_i ctx.ctx_z3 (date_to_int d)
|
||||
| LDuration d ->
|
||||
let y, m, _ = Runtime.duration_to_years_months_days d in
|
||||
let y, m, d = Runtime.duration_to_years_months_days d in
|
||||
if y <> 0 || m <> 0 then
|
||||
failwith
|
||||
"[Z3 encoding]: Duration literals containing years or months not \
|
||||
supported";
|
||||
Arithmetic.Integer.mk_numeral_i ctx.ctx_z3 (Runtime.duration_to_nb_days d)
|
||||
Arithmetic.Integer.mk_numeral_i ctx.ctx_z3 d
|
||||
|
||||
(** [find_or_create_funcdecl] attempts to retrieve the Z3 function declaration
|
||||
corresponding to the variable [v]. If no such function declaration exists
|
||||
|
Loading…
Reference in New Issue
Block a user