stainless
414
Stars
63
Forks
16
Watchers
344
Open Issues
Apache-2.0
许可证
Scala
语言
2016-08-17
创建时间
2026-11-11
最近更新
项目能做什么
Stainless 是一个面向 Scala 语言子集的形式化验证框架与工具。它主要解决高阶 Scala 程序的正确性验证问题,支持 Scala 3.5.0 及以上版本。核心功能是通过命令行对代码进行形式化分析,自动验证断言及模式匹配完备性等属性。
来源:AI 基于仓库事实生成
· 内容以仓库实际 README 为准
使用说明 查看原始 README 原仓库文档
中文使用说明暂未生成。下面保留原仓库 README 摘录,命令与配置均以原文为准。
原始 README 摘录(英文原文,节选前 3000 字符)
# Stainless [![Release][release-img]][latest-release] [](https://github.com/epfl-lara/stainless/actions/workflows/stainless-nightly.yml) [](https://github.com/epfl-lara/stainless/actions/workflows/stainless-CI.yml/?branch=main) [![Gitter chat][gitter-img]][gitter-ref] [![Apache 2.0 License][license-img]][license-ref]
Hosted at https://github.com/epfl-lara/stainless ; mirrored at https://gitlab.epfl.ch/lara/stainless . Check out also [Inox](https://github.com/epfl-lara/inox) and [Bolts](https://github.com/epfl-lara/bolts/).
Verification framework for a subset of the [Scala](http://scala-lang.org) programming language. See the [tutorial](https://epfl-lara.github.io/asplos2022tutorial/).
Please note that this repository uses `git submodules`, so you need to either:
- clone it with the `--recursive` option, or
- run `$ git submodule update --init --recursive` after cloning.
Please note that Stainless does not support Scala 2 frontend anymore, only Scala 3.5.0 and later. The latest release that supports Scala 2.13 frontend is the [v0.9.8.7](https://github.com/epfl-lara/stainless/releases/tag/v0.9.8.7).
## Quick start
We test mostly on [Ubuntu](https://ubuntu.com/download); on [Windows](https://www.microsoft.com/eb-gb/software-download/windows10), you can get sufficient text-based Ubuntu environment by installing [Windows Subsystem for Linux](https://learn.microsoft.com/en-us/windows/wsl/install) (e.g. `wsl --install`, then `wsl --install -d ubuntu`). Ensure you have a [Java](https://openjdk.org/projects/jdk/17/) version ready (it can be headless); on Ubuntu `sudo apt install openjdk-17-jdk-headless` suffices.
Once ready, [download the latest `stainless-dotty-standalone` release](https://github.com/epfl-lara/stainless/releases) for your platform. Unzip the archive, and run Stainless through the `stainless` script. Stainless expects a list of space-separated Scala files to verify but also has other [Command-line Options](https://epfl-lara.github.io/stainless/options.html).
To check if everything works, you may create a file named `HelloStainless.scala` next to the `stainless` script with the following content:
```scala
import stainless.collection._
object HelloStainless {
def myTail(xs: List[BigInt]): BigInt = {
require(xs.nonEmpty)
xs match {
case Cons(h, _) => h
// Match provably exhaustive
}
}
}
```
and run `stainless HelloStainless.scala`.
If all goes well, Stainless should report something along the lines:
```log
[ Info ] ┌───────────────────┐
[ Info ] ╔═╡ stainless summary ╞════════════════════════════════════════════════════════════════════╗
[ Info ] ║ └───────────────────┘ ║
[ Info ] ║ HelloStainless.scala:6:5: myTa
阅读完整原文
项目深度分析 AI 生成
高可靠 Scala 系统的形式化验证与审计服务
| 产品构想 | 基于 Stainless 工具链,为金融核心、交易引擎或跨链协议等采用 Scala 3 开发的关键系统提供代码级形式化验证咨询和安全审计认证。 |
| 核心功能 | 代码正确性定理证明、不变量检查与验证报告生成、反例排查与安全修复建议 |
| 目标用户 | FinTech 企业、Web3 基础设施团队、关键控制系统软件架构师 |
| 难度/周期 | 高 · 2-4个月(按项目交付) · 成本:极低(主要为高专业度人力与少量计算资源) |
| 收费模式 | 项目制形式化审计咨询费(单项目高客单价) |
| 竞争风险 | 形式化验证门槛极高,Scala 验证子集受限(仅支持部分语法),市场需求基数较窄 |
| 依据 | 已验证事实 |
面向 Scala 3 的企业级 CI/CD 形式化门禁与 IDE 插件 SaaS
| 产品构想 | 将 Stainless 打包为开箱即用的 GitHub Actions / GitLab CI 门禁检查服务,并开发 VS Code/IntelliJ 交互式反例诊断插件,降低开发者使用门槛。 |
| 核心功能 | 云端自动化求解器调度缓存、PR 自动化增量验证、图形化反例调用路径回溯、合规性徽章 |
| 目标用户 | 使用 Scala 3 的企业开发团队、DevSecOps 工程师 |
| 难度/周期 | 中等 · 3-6个月 · 成本:中等(云端 SMT 求解计算服务器、存储开销) |
| 收费模式 | 按席位或按 CI 验证算力调用时长订阅付费(SaaS) |
| 竞争风险 | SMT 求解资源消耗大导致服务器成本不可控;中小型团队对高阶形式化验证接受度有限 |
| 依据 | 数据支持的判断 |
Scala 3 形式化验证与安全编程企业内训课程
| 产品构想 | 将 EPFL 学术教程(如 ASPLOS/FMCAD 教程)商业化包装,提供面向企业研发团队的 Scala 形式化规约编写、SMT 求解调优及正确性驱动开发(Correctness-by-Construction)实战培训。 |
| 核心功能 | 手把手规约编写实战、常见边界漏洞建模、求解超时优化技巧、实战项目演练 |
| 目标用户 | 大型科技公司 Scala 架构师、技术团队负责人、高校/科研机构开发者 |
| 难度/周期 | 低 · 1-2个月 · 成本:极低(主要是课程教材研发) |
| 收费模式 | 企业内训采购费用、公开课门票收入 |
| 竞争风险 | 市场目标受众较为小众,复购率低,严重依赖讲师个人背书与学术界联系 |
| 依据 | AI推测 |
AI 基于仓库公开数据分析生成,含推测成分,不构成收益承诺。
报告会保存到 个人中心
竞品与相似项目 GitHub Search 真实检索
| 项目 | 中文简介 | Stars | 语言 |
|---|---|---|---|
| testsmt/yinyang | 中文介绍暂未生成 A fuzzing framework for SMT solvers |
201 | Python |
| kino-mc/rsmt2 | 中文介绍暂未生成 A generic library to interact with SMT-LIB 2 compliant solve |
69 | Rust |
| CVC4/CVC4-archived | 中文介绍暂未生成 CVC4 is an efficient open-source automatic theorem prover f |
23 | SMT |
以上为通过 GitHub 官方 Search API 检索的相似项目,功能差异与优劣势需进一步人工确认,配置 AI 后可生成对比分析。
项目优势与风险
| 技术成熟度 | 创建于 2016-08-17,近 30 天仍在推送,发布过 47 个 Release |
| 社区活跃 | Star 414 / Fork 63 / Issue 344(数据支持,可自行核实) |
| 许可证 | Apache-2.0 |
| 主要风险 | 上游项目方向可能变化;同赛道竞争者较多(见竞品表);热度与需求不完全等价 |
安装与使用
此项目未提供 Docker 镜像,安装步骤以原仓库 README 为准(涉及依赖安装与环境配置,对新手门槛较高)。