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

被引:0
|
作者
Rak-amnouykit, Ingkarat [1 ]
Milanova, Ana [1 ]
Baudart, Guillaume [2 ]
Hirzel, Martin [3 ]
Dolby, Julian [3 ]
机构
[1] Rensselaer Polytech Inst, 110 8th St, Troy, NY 12180 USA
[2] PSL Univ, INRIA, CNRS, Ecole Normale Super,DI ENS, Paris, France
[3] IBM Res, Armonk, NY USA
来源
SOFTWARE-PRACTICE & EXPERIENCE | 2024年 / 54卷 / 03期
基金
美国国家科学基金会;
关键词
interprocedural analysis; machine learning libraries; !text type='Python']Python[!/text; REFERENCE IMMUTABILITY; CHECKING;
D O I
10.1002/spe.3279
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
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.
引用
收藏
页码:363 / 393
页数:31
相关论文
共 22 条
  • [1] The Raise of Machine Learning Hyperparameter Constraints in Python']Python Code
    Rak-amnouykit, Ingkarat
    Milanova, Ana
    Baudart, Guillaume
    Hirzel, Martin
    Dolby, Julian
    [J]. PROCEEDINGS OF THE 31ST ACM SIGSOFT INTERNATIONAL SYMPOSIUM ON SOFTWARE TESTING AND ANALYSIS, ISSTA 2022, 2022, : 580 - 592
  • [2] Static Type Inference for Foreign Functions of Python']Python
    Hu, Mingzhe
    Zhang, Yu
    Huang, Wenchao
    Xiong, Yan
    [J]. 2021 IEEE 32ND INTERNATIONAL SYMPOSIUM ON SOFTWARE RELIABILITY ENGINEERING (ISSRE 2021), 2021, : 423 - 433
  • [3] Static Type Analysis for Python']Python
    Dong, Tiancong
    Chen, Lin
    Xu, Zhaogui
    Yu, Bin
    [J]. 2014 11TH WEB INFORMATION SYSTEM AND APPLICATION CONFERENCE (WISA), 2014, : 65 - 68
  • [4] Static Inference Meets Deep Learning: A Hybrid Type Inference Approach for Python']Python
    Peng, Yun
    Gao, Cuiyun
    Li, Zongjie
    Gao, Bowei
    Lo, David
    Zhang, Qirun
    Lyu, Michael
    [J]. 2022 ACM/IEEE 44TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING (ICSE 2022), 2022, : 2019 - 2030
  • [5] DLInfer: Deep Learning with Static Slicing for Python']Python Type Inference
    Yan, Yanyan
    Feng, Yang
    Fan, Hongcheng
    Xu, Baowen
    [J]. 2023 IEEE/ACM 45TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING, ICSE, 2023, : 2009 - 2021
  • [6] Unambiguity of Python']Python Language Elements for Static Analysis
    Nagy, Bence
    Brunner, Tibor
    Porkolab, Zoltan
    [J]. IEEE 21ST INTERNATIONAL WORKING CONFERENCE ON SOURCE CODE ANALYSIS AND MANIPULATION (SCAM 2021), 2021, : 70 - 75
  • [7] Evaluation of Static Analysis Methods of Python']Python Programs
    Gulabovska, Hristina
    Porkolab, Zoltan
    [J]. IPSI BGD TRANSACTIONS ON INTERNET RESEARCH, 2020, 16 (02): : 39 - 46
  • [8] Static Analysis of Corpus of Source Codes of Python']Python Applications
    Kapustin, D. A.
    Shvyrov, V. V.
    Shulika, T. I.
    [J]. PROGRAMMING AND COMPUTER SOFTWARE, 2023, 49 (04) : 302 - 309
  • [9] Static Value Analysis of Python']Python Programs by Abstract Interpretation
    Fromherz, Aymeric
    Ouadjaout, Abdelraouf
    Mine, Antoine
    [J]. NASA FORMAL METHODS, NFM 2018, 2018, 10811 : 185 - 202
  • [10] COBRApy: COnstraints-Based Reconstruction and Analysis for Python']Python
    Ebrahim, Ali
    Lerman, Joshua A.
    Palsson, Bernhard O.
    Hyduke, Daniel R.
    [J]. BMC SYSTEMS BIOLOGY, 2013, 7