Treffer: Principled and practical static analysis for Python: Weakest precondition inference of hyperparameter constraints

Title:
Principled and practical static analysis for Python: Weakest precondition inference of hyperparameter constraints
Contributors:
Rensselaer Polytechnic Institute (RPI), Les assistants à la démonstration au cœur du raisonnement mathématique (PICUBE), Centre Inria de Paris, Institut National de Recherche en Informatique et en Automatique (Inria)-Institut National de Recherche en Informatique et en Automatique (Inria)-Institut de Recherche en Informatique Fondamentale (IRIF (UMR_8243)), Centre National de la Recherche Scientifique (CNRS)-Université Paris Cité (UPCité)-Centre National de la Recherche Scientifique (CNRS)-Université Paris Cité (UPCité), IBM T. J. Watson Research Centre
Source:
Software: Practice and Experience. 54(3):363-393
Publisher Information:
CCSD; Wiley, 2024.
Publication Year:
2024
Collection:
collection:CNRS
collection:INRIA
collection:INRIA-ROCQ
collection:TESTALAIN1
collection:INRIA2
collection:UNIV-PARIS
collection:UNIVERSITE-PARIS
collection:UP-SCIENCES
collection:IRIF
collection:INRIA-ETATSUNIS
Original Identifier:
HAL: hal-04489590
Document Type:
Zeitschrift article<br />Journal articles
Language:
English
ISSN:
0038-0644
1097-024X
Relation:
info:eu-repo/semantics/altIdentifier/doi/10.1002/spe.3279
DOI:
10.1002/spe.3279
Rights:
info:eu-repo/semantics/OpenAccess
Accession Number:
edshal.hal.04489590v1
Database:
HAL

Weitere Informationen

Application programming interfaces often have correctness constraints that cut across multiple arguments. Violating these constraints causes the underlying code to raise runtime exceptions, but at the interface level, these are usually documented at most informally. This article presents novel principled static analysis and the first interprocedural weakest‐precondition analysis for Python to extract inter‐argument constraints. The analysis is mostly static, but to make it tractable for typical Python idioms, it selectively switches to the concrete domain for some cases. This article focuses on the important case where the interfaces are machine‐learning operators and their arguments are hyperparameters, rife with constraints. We extracted hyperparameter constraints for 429 functions and operators from 11 libraries and found real bugs. We used a methodology to obtain ground truth for 181 operators from 8 machine‐learning libraries; the analysis achieved high precision and recall for them. Our technique advances static analysis for Python and is a step towards safer and more robust machine learning.