# 使用 Homebrew, apk, chocolatey, apt, dnf, MacPorts, Nix, pacman, zypper, scoop 安装 z3

查看 z3 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:z3
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install z3
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install z3
```

  证据: MacPorts ports tree: math/z3/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- apk (92%):

```sh
sudo apk add z3
```

  证据: Alpine Linux edge package indexes: z3 from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz

- Debian apt (92%):

```sh
sudo apt install z3
```

  证据: Debian stable package indexes: z3 from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- dnf (92%):

```sh
sudo dnf install z3
```

  证据: Fedora Rawhide package metadata: z3 from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst

- Nix (92%):

```sh
nix profile install nixpkgs#z3
```

  证据: nixpkgs package indexes: pkgs/by-name/z3/z3/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

- pacman (92%):

```sh
sudo pacman -S z3
```

  证据: Arch Linux sync databases: z3 from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz

- zypper (92%):

```sh
sudo zypper install z3
```

  证据: openSUSE Tumbleweed package metadata: z3 from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst

### Windows

- Chocolatey (92%):

```sh
choco install z3
```

  证据: Chocolatey community package catalog: z3 from http://community.chocolatey.org/api/v2/Packages?$filter=IsLatestVersion&$select=Id&$top=1000&$skiptoken='6.7743998','highlight'

- Scoop (92%):

```sh
scoop install main/z3
```

  证据: Scoop official bucket manifest trees: bucket/z3.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1

## 软件包事实

- **软件包键:** brew:z3
- **软件包管理器:** Homebrew
- **版本:** 4.16.0
- **来源摘要:** High-performance theorem prover
- **主页:** <https://github.com/Z3Prover/z3>
- **仓库:** <https://github.com/Z3Prover/z3>
- **最后更新:** 2026-06-26T20:17:02-04:00
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- qprofdiff (别名)
- z3 (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 4.16.0
## 项目历史与用法

Z3 is Microsoft Research's SMT solver and theorem prover, used to check satisfiability of logical formulas over theories such as arithmetic, bit-vectors, arrays, datatypes, uninterpreted functions, and quantifiers. It is both a command-line solver and a library with bindings across multiple programming languages.

Among package-manager projects, Z3 is unusually important: it is a research artifact, a production verification engine, a dependency for program-analysis tools, and a local CLI that users install when they need real automated reasoning rather than a web service.

### 项目历史

Microsoft Research says work on Z3 began in 2006, motivated by program verification and dynamic symbolic execution. The 2008 TACAS paper introduced it as a freely available SMT solver from Microsoft Research for software verification and analysis applications.

Z3's early design emphasized a general interface so that other software analysis tools could embed it. The official Z3 Guide still presents it as a low-level component: best used inside other tools that map their verification or modeling problems into logical formulas.

The public GitHub repository was created in March 2015, matching the period when Z3 moved from a Microsoft Research download into a modern open-source package workflow. The repository README now documents stable and nightly binaries, CMake, Makefile, Visual Studio, Bazel, and vcpkg builds, plus language bindings for C, C++, .NET, Java, Go, OCaml, Python, Julia, WebAssembly/TypeScript/JavaScript, and other interfaces.

Z3 continued to evolve well after its initial verification focus. Microsoft Research's 2019 retrospective highlights model-based SMT techniques, SPACER and Horn-clause solving, quantifier instantiation, and applications that ranged beyond the original program-verification and symbolic-execution use cases.

### 采用历史

The 2008 Microsoft Research publication states that Z3 was used in software verification and analysis applications. Later Microsoft Research material names the original design pressures as program verification and dynamic symbolic execution, and points to use cases such as Dafny, automatic test generation, fuzz testing, biological computation analysis, quantum-computing-related problems, Azure firewall reasoning, network verification, and smart-contract analysis.

Z3's academic adoption is unusually visible: Microsoft Research reported more than 5,000 citations since 2008 in its 2019 blog post, and its awards include the 2015 ACM SIGPLAN Programming Languages Software Award, the 2018 ETAPS Test of Time Award, the 2019 Herbrand Award for de Moura and Bjørner's theorem-proving work, and related automated-reasoning honors listed on Nikolaj Bjørner's Microsoft Research page.

Its package adoption is broad because Z3 is useful from both shells and libraries. The input facts for this enrichment run list packages across Homebrew, Debian, Ubuntu, Fedora, Arch, Nix, MacPorts, Scoop, apk, and zypper ecosystems, while the upstream README points to PyPI, npm/WebAssembly, NuGet, vcpkg, and source builds.

### 使用方式

At the command line, users typically feed Z3 SMT-LIB2 formulas and ask for satisfiability, models, proofs, or solver diagnostics. The Z3 Guide describes SMT-LIB as a community standard with Lisp-like syntax for tool serialization, and notes that Z3 supports the main SMT-LIB2 theories.

As a library, Z3 is embedded in analyzers, compilers, configuration systems, testing tools, verification systems, model checkers, synthesis tools, and research prototypes. Bindings let programs construct formulas directly instead of writing SMT-LIB strings by hand.

For package users, installing z3 locally gives reproducible solver behavior for build/test pipelines, formal-methods coursework, theorem-proving experiments, smart-contract analyzers, symbolic execution engines, and other tools that shell out to z3 or link libz3.

### 为什么软件包爱好者会关心

Z3 is one of the canonical examples of a serious research solver that became ordinary package-manager infrastructure. It is not merely installed by specialists; it sits under higher-level tools that users may not think of as theorem provers at all.

It matters to package nerds because packaging a solver means packaging trust boundaries: binary compatibility for libz3, language bindings, SMT-LIB behavior, release cadence, and reproducible answers across platforms. A small formula can depend on solver version and build flags, so having well-maintained distro and language packages is part of the tool's scientific and engineering value.

Z3 also marks a bridge between academic automated reasoning and everyday developer automation. The same executable can appear in a research paper artifact, a CI verification job, a Python notebook, an Azure/network-analysis pipeline, or a Homebrew install on a laptop.

### 时间线

- 2006: Microsoft Research begins work on Z3, motivated by program verification and dynamic symbolic execution.
- 2008-03: The TACAS paper 'Z3: an efficient SMT solver' is published.
- 2015-03-26: The public Z3Prover/z3 GitHub repository is created.
- 2015-06-15: Microsoft Research reports Z3 receiving the ACM SIGPLAN Programming Languages Software Award.
- 2018: Microsoft Research material records Z3 receiving an ETAPS Test of Time Award.
- 2019-10-16: Microsoft Research publishes a retrospective on Z3's model-based SMT techniques and broad adoption.
- 2026-02-19: GitHub releases list z3-4.16.0 as a stable release.
- 2026-07-02: GitHub metadata shows active development on the day of this enrichment run.

### Related projects

- SMT-LIB is the standard input language and benchmark ecosystem used by Z3 and other SMT solvers.
- Dafny is a verification-oriented programming language named by Microsoft Research as one of the program-verification contexts around Z3.
- SPACER is Z3's constrained-Horn-clause/model-checking engine lineage discussed in Microsoft Research material.
- Boogie, Pex, fuzzing systems, network-verification tools, and smart-contract analyzers are adjacent users or tool families in Z3's adoption story.

### 来源

- <https://api.github.com/repos/Z3Prover/z3>
- <https://api.github.com/repos/Z3Prover/z3/releases>
- <https://github.com/Z3Prover/z3>
- <https://microsoft.github.io/z3guide/docs/logic/intro/>
- <https://raw.githubusercontent.com/Z3Prover/z3/master/README.md>
- <https://www.microsoft.com/en-us/research/blog/the-inner-magic-behind-the-z3-theorem-prover/>
- <https://www.microsoft.com/en-us/research/people/nbjorner/>
- <https://www.microsoft.com/en-us/research/project/z3-3/news-and-awards/>
- <https://www.microsoft.com/en-us/research/publication/z3-an-efficient-smt-solver/>


## 安全说明

narrow executable package without higher-risk signals.

- **Geiger 风险:** 绿色 / 低
- narrow executable package without higher-risk signals

## 其他软件包管理器记录

- Debian apt - libz3-4 - 4.13.3-1: normalized package name match | Debian stable package indexes: libz3-4 from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | theorem prover from Microsoft Research - runtime libraries | https://github.com/Z3Prover/z3
- Debian apt - libz3-dev - 4.13.3-1: normalized package name match | Debian stable package indexes: libz3-dev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | theorem prover from Microsoft Research - development files | https://github.com/Z3Prover/z3
- Debian apt - libz3-java - 4.13.3-1: normalized package name match | Debian stable package indexes: libz3-java from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | theorem prover from Microsoft Research - java bindings | https://github.com/Z3Prover/z3
- Debian apt - libz3-jni - 4.13.3-1: normalized package name match | Debian stable package indexes: libz3-jni from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | theorem prover from Microsoft Research - JNI library | https://github.com/Z3Prover/z3
- Debian apt - python3-z3 - 4.13.3-1: normalized package name match | Debian stable package indexes: python3-z3 from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | theorem prover from Microsoft Research - Python 3 bindings | https://github.com/Z3Prover/z3
- Debian apt - z3 - 4.13.3-1: normalized package name match | Debian stable package indexes: z3 from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | theorem prover from Microsoft Research | https://github.com/Z3Prover/z3
- Nix - z3: normalized package name match | nixpkgs package indexes: pkgs/by-name/z3/z3/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - libz3-4 - 4.8.12-3.1build1: normalized package name match | Ubuntu 24.04 LTS package indexes: libz3-4 from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | theorem prover from Microsoft Research - runtime libraries | https://github.com/Z3Prover/z3
- Ubuntu apt - libz3-dev - 4.8.12-3.1build1: normalized package name match | Ubuntu 24.04 LTS package indexes: libz3-dev from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | theorem prover from Microsoft Research - development files | https://github.com/Z3Prover/z3
- Ubuntu apt - libz3-java - 4.8.12-3.1build1: normalized package name match | Ubuntu 24.04 LTS package indexes: libz3-java from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | theorem prover from Microsoft Research - java bindings | https://github.com/Z3Prover/z3
- Ubuntu apt - libz3-jni - 4.8.12-3.1build1: normalized package name match | Ubuntu 24.04 LTS package indexes: libz3-jni from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | theorem prover from Microsoft Research - JNI library | https://github.com/Z3Prover/z3
- Ubuntu apt - python3-z3 - 4.8.12-3.1build1: normalized package name match | Ubuntu 24.04 LTS package indexes: python3-z3 from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | theorem prover from Microsoft Research - Python 3 bindings | https://github.com/Z3Prover/z3
- Ubuntu apt - z3 - 4.8.12-3.1build1: normalized package name match | Ubuntu 24.04 LTS package indexes: z3 from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | theorem prover from Microsoft Research | https://github.com/Z3Prover/z3
- apk - py3-z3 - 4.16.0-r1: normalized package name match | Alpine Linux edge package indexes: py3-z3 from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Python bindings for z3 | https://github.com/Z3Prover/z3
- apk - z3 - 4.16.0-r1: normalized package name match | Alpine Linux edge package indexes: z3 from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Theorem prover from Microsoft Research | https://github.com/Z3Prover/z3
- apk - z3-dev - 4.16.0-r1: normalized package name match | Alpine Linux edge package indexes: z3-dev from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Theorem prover from Microsoft Research (development files) | https://github.com/Z3Prover/z3


## Combined YAML source

View the package source record on GitHub. [combined/z3.yml](https://github.com/mxcl/pkgdb/blob/main/combined/z3.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
