| Crates.io | gatesim |
| lib.rs | gatesim |
| version | 0.1.1 |
| created_at | 2025-02-21 17:00:05.894785+00 |
| updated_at | 2025-08-12 06:00:33.850461+00 |
| description | The base library for the Gate Project. |
| homepage | |
| repository | https://github.com/matszpk/gatesim |
| max_upload_size | |
| id | 1564466 |
| size | 218,271 |
The base library of the Gate Project. It provides basic types of circuits and basic methods to operate on that circuits. The library doesn't provide complex simulation routines. This library is really base of the Gate Project.
The basic type of circuit [Circuit] is constructed from gates of following types:
The type of circuit is parametrized by type of wire index. It can be unsigned integer
for example u32.
The circuit defined by input length (number), gates and outputs that are defined by wire and negation. If wire index is index of circuit input or index of gate output. The input of circuit starts from 0. The output of gate starts from input length number. The circuit can be constructed from gates satisfied following constraints:
Additional type of circuit [ClauseCircuit] is constructed from clauses. The clause is gate that uses any number of inputs. The clause contains literals (input wire that can be negated or not). The are two clause types:
Similary, the clause circuit defined by input length (number), clauses and outputs that are defined by wire and negation. If wire index is index of circuit input or gate output. The input of circuit starts from 0. The output of gate starts from input length number. The circuit can be constructed from gates satisfied following constraints:
Derived [QuantCircuit] from [Circuit] provides additional information about quantifiers. These quantifiers can be used to evaluate or solve quantified formula defined by circuit. There are two types of quantifiers:
Number of quantifiers must match to input length. Any sequence of quantifiers for inputs determine single quantifier for some input length. Number of output must be 1.
For describe: [all,all,exists,exists,all,all] - formula is true if for all combinations of
input0, input1 can be found some combination of input2,input3 all combinations
input4, input5 circuit returns true.
Similary, [QuantClauseCircuit] is derive from [ClauseCircuit]. It provides information about quantifiers. These same constraints applied like in QuantCircuits.