@@ -30,12 +30,20 @@ def __init__(self, kompile_command: str):
3030 super ().__init__ (f'Kompile command not found: { str } ' )
3131
3232
33+ class TypeInferenceMode (Enum ):
34+ Z3 = 'z3'
35+ SIMPLESUB = 'simplesub'
36+ CHECKED = 'checked'
37+ DEFAULT = 'default'
38+
39+
3340def kompile (
3441 main_file : str | Path ,
3542 * ,
3643 command : Iterable [str ] = ('kompile' ,),
3744 output_dir : str | Path | None = None ,
3845 temp_dir : str | Path | None = None ,
46+ type_inference_mode : str | TypeInferenceMode | None = None ,
3947 debug : bool = False ,
4048 verbose : bool = False ,
4149 cwd : Path | None = None ,
@@ -48,6 +56,7 @@ def kompile(
4856 command = command ,
4957 output_dir = output_dir ,
5058 temp_dir = temp_dir ,
59+ type_inference_mode = type_inference_mode ,
5160 debug = debug ,
5261 verbose = verbose ,
5362 cwd = cwd ,
@@ -115,6 +124,7 @@ def __call__(
115124 * ,
116125 output_dir : str | Path | None = None ,
117126 temp_dir : str | Path | None = None ,
127+ type_inference_mode : str | TypeInferenceMode | None = None ,
118128 debug : bool = False ,
119129 verbose : bool = False ,
120130 cwd : Path | None = None ,
@@ -138,6 +148,10 @@ def __call__(
138148 temp_dir = Path (temp_dir )
139149 args += ['--temp-dir' , str (temp_dir )]
140150
151+ if type_inference_mode is not None :
152+ type_inference_mode = TypeInferenceMode (type_inference_mode )
153+ args += ['--type-inference-mode' , type_inference_mode .value ]
154+
141155 if debug :
142156 args += ['--debug' ]
143157
0 commit comments