@INPROCEEDINGS{Hanus24APLAS, author = "Hanus, M.", title = "Hybrid Verification of Declarative Programs with Arithmetic Non-fail Conditions", year = "2024", pages = "109-129", booktitle = "Proc. of the 22nd Asian Symposium on Programming Languages and Systems (APLAS 2024)}", publisher = {Springer LNCS 15194}, doi = {10.1007/978-981-97-8943-6\_6}, abstract = { Functions containing arithmetic operations have often restrictions not expressible by standard type systems of programming languages. The division operation requires that the divisor is non-zero and the factorial function should not be applied to negative numbers. Such partial operations might lead to program crashes if they are applied to unintended arguments. Checking the arguments before each call is tedious and decreases the run-time efficiency. To avoid these disadvantages and support the safe use of partially defined operations, we present an approach to verify the correct use of operations at compile time. To simplify its use, our approach automatically infers non-fail conditions of operations from their definitions and checks whether these conditions are satisfied for all uses of the operations. Arithmetic conditions can be verified by SMT solvers, whereas conditions in operations defined on algebraic data types can be inferred and verified by appropriate type abstractions. Therefore, we present a hybrid method which is applicable to larger programs since only a few arithmetic non-fail conditions need to be checked by an external SMT solver. This approach is implemented for functional logic Curry programs so that it is also usable for purely functional or logic programs. } }