Typify: A Lightweight Usage-driven Static Analyzer for Precise Python Type Inference
Python’s dynamic type system, while offering significant flexibility and expressiveness, poses substantial challenges for static analysis and automated tooling, particularly in unannotated or partially annotated codebases. Existing type inference approaches often depend on existing type annotations, or on deep learning models that require extensive training corpora and considerable computational resources, resulting in limited scalability and reduced interpretability. We introduce Typify, a lightweight, usage-driven static analysis engine designed to infer precise and contextually relevant type information without relying on statistical learning or large datasets. Typify integrates symbolic execution with iterative fixpoint analysis and a context-matching retrieval system to propagate and predict type information across entire projects. By constructing and traversing dependency graphs in an execution-aware manner, Typify accurately connects function calls to their definitions and infers usage-based type semantics, even in complex, interdependent modules. We evaluate Typify on a diverse corpus of real-world Python repositories, including the ManyTypes4Py and Typilus datasets, benchmarking its effectiveness in predicting types of variables, arguments, and return statements. Results from the evaluation show that Typify consistently matches or surpasses state-of-the-art deep learning–based systems such as Type4Py and HiTyper, as well as industry standard static type inference tools like Pyre. Our findings demonstrate that usage-driven, retrieval-based inference can match or exceed the accuracy of data-driven methods, offering a practical, interpretable, and computationally efficient alternative for large and evolving Python codebases.
Sun 12 AprDisplayed time zone: Brasilia, Distrito Federal, Brazil change
11:00 - 12:30 | Session 1 - Code AnalysisResearch Track / ICPC Program / Early Research Achievements (ERA) at Europa II Chair(s): Igor Wiese Federal University of Technology | ||
11:00 10mTalk | Pretraining on Call Graphs: When Binary Analysis Tasks Profit From Context Research Track Pre-print Media Attached | ||
11:10 10mTalk | LuaReSym: Recovering Variables Liveness Range in Stripped Lua Bytecode via Multi-Stage Static Analysis Research Track Weilong Li School of Computer Science and Engineering,Sun Yat-sen University, Ruizhi Xiao School of Computer Science and Engineering,Sun Yat-sen University, Yabo Wang School of Computer Science and Engineering,Sun Yat-sen University, Jiakun Sun School of Computer Science and Engineering,Sun Yat-sen University, Yuqing Shao School of Information Science and Engineering, East China University of Science and Technology, Shuyuan Jin School of Computer Science and Engineering,Sun Yat-sen University | ||
11:20 10mTalk | Modubin: A Binary Modularization Approach Based on the Locality of Homologous Functions Research Track Wenyan Yu Institute of Information Engineering, Chinese Academy of Sciences; School of Cyber Security, University of Chinese Academy of Sciences, Lei Cui Zhongguancun Laboratory, Jiayuan Li Institute of Information Engineering, Chinese Academy of Sciences; School of Cyber Security, University of Chinese Academy of Sciences, liyubo Institute of Information Engineering, Chinese Academy of Sciences; School of Cyber Security, University of Chinese Academy of Sciences, Hong Li Institute of Information Engineering at Chinese Academy of Sciences, Kai Cheng Institute of Information Engineering, Chinese Academy of Sciences; School of Cyber Security, University of Chinese Academy of Sciences, Hongsong Zhu Institute of Information Engineering at Chinese Academy of Sciences; University of Chinese Academy of Sciences DOI Media Attached | ||
11:30 10mTalk | RlDecompiler: Enhancing LLM-based Decompilation via Reinforcement Learning with a Multi-Faceted Reward Function Research Track Yuchi Su University of Electronic Science and Technology of China, Weina Niu University of Electronic Science and Technology of China, Jiacheng Gong University of Electronic Science and Technology of China, Ran Yan University of Electronic Science and Technology of China, Song Li The State Key Laboratory of Blockchain and Data Security, Zhejiang University, Xin Liu Lanzhou University, Xiaosong Zhang University of Electronic Science and Technology of China | ||
11:40 10mTalk | A Multi-Agent Framework for Automated Exploit Generation with Constraint-Guided Comprehension and Reflection Research Track Siyi Chen Alibaba Group, Tianhan Luo Alibaba Group, Shijian Wu Alibaba Group, Xiangyu Liu Alibaba Group, Yilin Zhou Wuhan University, Qi Li Alibaba Group, Wenyuan Xu Aarhus University Pre-print | ||
11:50 10mTalk | Typify: A Lightweight Usage-driven Static Analyzer for Precise Python Type Inference Research Track Ali Aman University of Windsor, Muhammad Asaduzzaman University of Windsor, Shaowei Wang University of Manitoba Pre-print | ||
12:00 10mTalk | To GOTO or Not to GOTO: Measuring Structural Complexity of (Decompiled) Code Research Track | ||
12:10 5mTalk | Understanding Type Hints in Python Libraries and Frameworks: Early Insights Early Research Achievements (ERA) | ||
12:15 10mLive Q&A | Joint QA and Discussion ICPC Program | ||