jeannin / zelus

A synchronous language with ODEs
http://zelus.di.ens.fr
Other
0 stars 4 forks source link

Combinatorial expression expected to be static #76

Open jlvargasme opened 1 year ago

jlvargasme commented 1 year ago

let add (x : {v:float|v>0} ) (y : {v:float|v>0} ) : { v:float | v >= x && v >= y} = let z = x +. y in z

let f6 (x : {v : float | v < 0 }) : {v : float | v > 0} = let y = x *. x in add y y

The previous code does not type checks, with the following error:

File "refinement_function_test.zls", line 59, characters 5-6: add y y ^ Type error: this is a combinatorial expression and is expected to be static.

It seems that the first y argument is causing trouble because the following passes the type check let f6 (x : {v : float | v < 0 }) : {v : float | v > 0} = let y = x *. x in add 1. y