目录

Tai-e-Cangjie

A general-purpose static analysis framework for Cangjie

Table of Contents

What is Tai-e-Cangjie?

Tai-e-Cangjie (Chinese: 太阿仓颉版) is a general-purpose static analysis framework for Cangjie. It processes the Cangjie High-level Intermediate Representation (CHIR) generated by the Cangjie compiler and can be used both as a standalone analysis tool and as a framework for developing new analyses of Cangjie programs.

Tai-e-Cangjie currently provides the following major analysis components:

  • Pointer analysis framework
    • Whole-program pointer analysis for Cangjie programs
    • On-the-fly call-graph construction
    • Configurable context sensitivity and Cangjie-oriented analysis plugins
  • Control-flow and data-flow analysis framework
    • Control-flow graph and interprocedural control-flow graph construction
    • Exception information for analyses that require exceptional control flow
    • Classic analyses such as live variables, available expressions, reaching definitions, and constant propagation
    • Reusable abstractions for developing new data-flow analyses
  • Fundamental analyses and analysis clients
    • Exception, side-effect, and def-use analyses
    • Analysis clients for potentially failing casts, polymorphic call sites, dead code, and null pointers
  • Analysis development and inspection tools
    • Configurable analysis management and dependency handling
    • Intermediate-representation and analysis-result dumpers
    • Interpreter-based validation support

The precise behavior and availability of an analysis may depend on the Cangjie language model and selected analysis options. See the user manual for the analyses and options exposed by this release.

Tai-e-Cangjie is developed in Java and can run on major operating systems supported by Java 17.

Relationship with Tai-e

Tai-e-Cangjie is built on Tai-e, a developer-friendly static analysis framework originally designed for Java. Tai-e provides the foundational abstractions and infrastructure for type and intermediate-representation modeling, analysis management, pointer analysis, call-graph construction, graph processing, and data-flow analysis. Its design follows the HBDC (Harnessing the Best Designs of Classics) principle described in the Tai-e ISSTA 2023 paper.

On this foundation, Tai-e-Cangjie introduces a CHIR-based frontend and Cangjie program model, extends the type system and intermediate representations for Cangjie, adapts pointer-analysis rules and call resolution to Cangjie semantics, and models language mechanisms such as generics, closures, value semantics, and relevant runtime behavior.

Together, the Tai-e infrastructure and these Cangjie-specific components form the Tai-e-Cangjie analysis framework. The Tai-e paper and upstream materials describe the foundational framework and its general analysis design; the Tai-e-Cangjie paper and this repository describe the Cangjie-language support and its implementation.

How to Obtain Runnable Tai-e-Cangjie?

Tai-e-Cangjie requires Java 17 or a newer version. Build the runnable all-in-one JAR from source with Gradle:

./gradlew fatJar

The JAR is generated at build/tai-e-all-v1.2-cj1.0.5.jar. You can inspect the available command-line options with:

java -jar build/tai-e-all-v1.2-cj1.0.5.jar -h

Analyzing a Cangjie program also requires the CHIR generated by the supported Cangjie toolchain. When compiling the program with cjc, pass --save-temps <dir> to save the intermediate compilation results, including the serialized CHIR, to the specified directory:

cjc --save-temps <chir-output-dir> [other cjc options] <source files>

For a project built with cjpm, add the option to the project’s cjpm.toml. Using override-compile-option is recommended because it applies to the entry module and all modules built as its dependencies:

[package]
override-compile-option = "--save-temps ./build/taie-chir"

For a workspace, place the same option under [workspace]. If CHIR is needed only for the current module, compile-option may be used instead; unlike override-compile-option, it applies only to the packages in that module.

Use the generated CHIR directory as input to Tai-e-Cangjie. Analysis also requires the standard-library CHIR that matches the Cangjie toolchain version. See the command-line documentation for the corresponding class-path options and analysis options.

Version and Compatibility

Tai-e-Cangjie v1.2-cj1.0.5 is the first public release and targets Cangjie 1.0.5.

Tai-e-Cangjie v1.2-cj1.0.5 guarantees compatibility only with the Cangjie 1.0.5 toolchain baseline against which it is developed and tested. Other toolchain versions may work, but they are not systematically verified and are outside the officially supported scope.

The release identifier combines both version dimensions: v1.2 is the Tai-e-Cangjie project version, and cj1.0.5 identifies the supported Cangjie toolchain baseline. This scheme allows the same Tai-e-Cangjie version to be released for different Cangjie frontend versions when needed.

Documentation

Research and Citation

Tai-e-Cangjie is the software artifact accompanying the research work on extending Tai-e’s static-analysis capabilities to Cangjie. Citation information for the Tai-e-Cangjie paper will be added when it becomes available.

The foundational Tai-e framework is described in the following ISSTA 2023 paper:

Tian Tan and Yue Li. 2023. Tai-e: A Developer-Friendly Static Analysis Framework for Java by Harnessing the Good Designs of Classics. In Proceedings of the 32nd ACM SIGSOFT International Symposium on Software Testing and Analysis (ISSTA ‘23). DOI · BibTeX

License

Tai-e-Cangjie follows Tai-e’s open-source licensing terms. See COPYING and COPYING.LESSER.

关于

太阿仓颉版基础程序分析平台

78.3 MB
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9 京公网安备 11010802047560号