"Hilbert's Nullstellensatz is a celebrated theorem that allows us to construct a 'dictionary' between Geometry (varieties) and Algebra (ideals)." -- David Cox et al.
The nullstellensatz CLI is a tool to construct a 'dictionary' between Combinatorics and Theory of Algorithms. It is part of my master's thesis in mathematical science.
This project is based on Clojure. To generate the CLI and run benchmarks the following dependencies are required:
- Hyperfine: A command-line benchmarking tool.
- Leiningen: Project automation for Clojure.
- Sdkman: Software development kit manager.
- GraalVM: Advanced JDK with ahead-of-time native image compilation.
- Babashka: Native Clojure interpreter for scripting with fast startup.
- Matplotlib: Visualization with Python.
In Ubuntu, run the following commands to install the dependencies
sudo apt install python3-matplotlib leiningen hyperfine build-essential zlib1g-dev
curl -s "https://get.sdkman.io" | bash
source "$HOME/.sdkman/bin/sdkman-init.sh"
sdk install java 23.0.1-graalFinally, running bb build generates the nulls CLI.
# Count the number of subsets of the finite set [6]
./nulls --enumerate-subset-object "{:n 6}" # => 64
# Generate the object with index 50 (a subset) of the finite set [6]
./nulls --generate-subset-object "{:n 6 :m 50}" # => (1 5 6)# Count the number of k-combinations (with k = 3) of the finite set [6]
./nulls --enumerate-combination-object "{:n 6 :k 3}" # => 20
# Generate the object with index 10 (a 3-combination) of the finite set [6]
./nulls --generate-combination-object "{:n 6 :k 3 :m 10}" # => [3 4 5]# Count the number of set-partitions of the finite set [6]
./nulls --enumerate-set-partition-object "{:n 6}" # => 203
# Generate the object with index 100 (a set-partition) of the finite set [6]
./nulls --generate-set-partition-object "{:n 6 :m 100}" # => [[1 5] [2 3 4 6]]# Count the number of catalan objects of the finite set [3]
./nulls --enumerate-catalan-family-object "{:n 3}" # => 5
# Generate the object with index 3 (a dyck path) of the finite set [3]
./nulls --generate-catalan-family-object "{:n 3 :m 3}" # => [[0 0] [1 1] [2 2] [3 1] [4 0] [5 1] [6 0]]# Count the number of complete linked diagrams of the finite set [3]
./nulls --enumerate-complete-linked-diagram-object "{:n 3}" # => 15
# Generate the object with index 11 (a complete linked diagram) of the finite set [3]
./nulls --generate-complete-linked-diagram-object "{:n 3 :m 11}" # => #{#{0 1} #{3 5} #{4 2}}# Count the number of irreducible linked diagrams of the finite set [5]
./nulls --enumerate-irreducible-linked-diagram-object "{:n 5}" # => 248
# Generate the object with index 200 (an irreducible linked diagram) of the finite set [5]
./nulls --generate-irreducible-linked-diagram-object "{:n 5 :m 200}" # => ([1 3] [2 8] [4 6] [5 9] [7 10])# Count the number of labeled connected graphs of the finite set [5]
./nulls --enumerate-labeled-connected-graph-object "{:n 5}" # => 728
# Generate the object with index 700 (a labeled connected graph) of the finite set [5]
./nulls --generate-labeled-connected-graph-object "{:n 5 :m 700}" # => [[2 3] [1 3] [1 4] [1 5] [2 5] [3 5] [4 5]]The available values for the --object parameter are: subset, combination, set-partition, catalan, complete-linked-diagram, irreducible-linked-diagram, and labeled-connected-graph. Other useful options are:
--runs: number of times the./nullsCLI runs with fixed parameters. It acts as the sample size for the measurement (generally we use the mean).--warmup: number of runs used to identify variability and potential outliers in the environment.--index: this parameter is used in generation only (bb generate). It is useful to generate a specific object and works like:min the./nullsCLI.
# BENCHMARK | Count the number of subsets of the finite sets [1], [2], ..., [100]
bb enumerate --from="1" --to="100" --object="subset"
# BENCHMARK | Generate the objects with index 0 (empty subsets) of the finite sets [1], [2], ..., [100]
bb generate --from="1" --to="100" --object="subset"These commands will generate json files with an ID built from a timestamp and a code in the directory /data, e.g. enumerate-1a100-2024-01-23-09-25-07.json and generate-1a100-2024-01-19-18-28-22.json respectively. Finally, to render a plot from a given benchmark there is a Python script:
./script/plot.py ./data/enumerate-1a100-2024-01-23-09-25-07.jsonCopyright © 2026 Brahayan Xavier Suárez Ramírez
This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 which is available at http://www.eclipse.org/legal/epl-2.0.
This Source Code may also be made available under the following Secondary Licenses when the conditions for such availability set forth in the Eclipse Public License, v. 2.0 are satisfied: GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version, with the GNU Classpath Exception which is available at https://www.gnu.org/software/classpath/license.html.