Skip to content

Commit c822cdd

Browse files
committed
menu and formats revised
1 parent f0deda4 commit c822cdd

File tree

6 files changed

+43
-35
lines changed

6 files changed

+43
-35
lines changed

circom/src/input_user.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ mod input_processing {
368368
.long("O1")
369369
.hidden(false)
370370
.takes_value(false)
371-
.help("Only applies var to var and var to constant simplification")
371+
.help("Only applies signal to signal and signal to constant simplification")
372372
.display_order(460)
373373
)
374374
.arg(
@@ -423,7 +423,7 @@ mod input_processing {
423423
.long("simplification_substitution")
424424
.takes_value(false)
425425
.display_order(980)
426-
.help("Outputs the substitution in json format"),
426+
.help("Outputs the substitution applied in the simplification phase in json format"),
427427
)
428428
.arg(
429429
Arg::with_name("print_sym")

mkdocs/docs/circom-language/formats/simplification-json.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ The file contains a dictionary where the entries are the numbers of the simplifi
1515
where the linear expression is represented by a dictionary with the signal numbers as strings occurring in the linear expression (with non-zero coefficient) as entries and their coefficients (as string) as values:
1616
`{ "sig_num_l1": "coef_1", ... , "sig_num_lm": "coef_m"}`
1717

18-
All signals occurring in the linear expression are signals that are not removed. Hence, if you also include the ```--sym``` flag, in the generated [sym file](../sym.md) all these signals are associated to a position in the witness list. On the other hand, al signals sig_num_1 ... sig_num_n that appear as entries in the substitution dictionary are associated to -1.
18+
All signals occurring in the linear expression are signals that are not removed. Hence, if you also include the ```--sym``` flag, in the generated [sym file](sym.md) all these signals are associated to a position in the witness list. On the other hand, al signals sig_num_1 ... sig_num_n that appear as entries in the substitution dictionary are associated to -1.
1919

2020
Let us consider the following simple circuit in 'simplify.circom':
2121

mkdocs/docs/circom-language/formats/sym.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The format provides a list of lines, where each line contains the information ab
1111
```
1212
where
1313
* #s: a positive number. It is the unique number starting in 1 (0 is reserved to the signal holding the constant value 1) which is assigned by the circom compiler to each signal in the circuit.
14-
* #w: an integer larger than or equal to -1. It gives either the position in the witness where the signal occurs or -1 if the signal is not public and does not occur in any constraint in the generated R1CS. Note that many signals do not appear in the final R1CS because they have been replaced by a linear combination of other signals that is equivalent to it in the simplification phase. In order to know the substitution applied to a removed signal one can add the flag --simplification_substitution to the circom call and check the generated [json file](../simplification-json.md). All witness positions except 0 (which is again reserved to the constant value 1) must occur once in the sym file. The length of the witness coincides with the number of (different) signals occurring in the generated R1CS plus one (for the constant 1).
14+
* #w: an integer larger than or equal to -1. It gives either the position in the witness where the signal occurs or -1 if the signal is not public and does not occur in any constraint in the generated R1CS. Note that many signals do not appear in the final R1CS because they have been replaced by a linear combination of other signals that is equivalent to it in the simplification phase. In order to know the substitution applied to a removed signal one can add the flag --simplification_substitution to the circom call and check the generated [json file](simplification-json.md). All witness positions except 0 (which is again reserved to the constant value 1) must occur once in the sym file. The length of the witness coincides with the number of (different) signals occurring in the generated R1CS plus one (for the constant 1).
1515
* #c: a non-negative integer (starting in 0). It is the unique number given by the compiler to the component the signal belongs to.
1616
* name: is a string containing the qualified name of the signal (including the complete component path).
1717

mkdocs/docs/getting-started/compilation-options.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ FLAGS:
1212
--wat Compiles the circuit to wat
1313
-c, --c Compiles the circuit to c
1414
--O0 No simplification is applied
15-
--O1 Only applies var to var and var to constant simplification
15+
--O1 Only applies signal to signal and signal to constant simplification
1616
--O2 Full constraint simplification
1717
--verbose Shows logs during compilation
1818
--inspect Does an additional check over the constraints produced
1919
--use_old_simplification_heuristics Applies the old version of the heuristics when performing linear
2020
simplification
21-
--simplification_substitution Outputs the substitution in json format
21+
--simplification_substitution Outputs the substitution applied in the simplification phase in json format
2222
-h, --help Prints help information
2323
-V, --version Prints version information
2424

@@ -53,7 +53,7 @@ In the following, we explain these options.
5353

5454

5555
#####Flags and options related to the R1CS optimization
56-
In the following, we explain the different optimizations that we can apply to the final R1CS during the constraint generation phase.
56+
In the following, we explain the different optimizations that we can apply to the final R1CS during the constraint generation phase. More details on the simplification process can be found [here](../circom-language/circom-insight/simplification.md)
5757

5858
* Flag ```--O0``` does not apply any kind of simplification.
5959

mkdocs/docs/getting-started/compiling-circuits.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ circom --help
2626
--wat Compiles the circuit to wat
2727
-c, --c Compiles the circuit to c
2828
--O0 No simplification is applied
29-
--O1 Only applies var to var and var to constant simplification
29+
--O1 Only applies signal to signal and signal to constant simplification
3030
--O2 Full constraint simplification
3131
--verbose Shows logs during compilation
3232
--inspect Does an additional check over the constraints produced
3333
--use_old_simplification_heuristics Applies the old version of the heuristics when performing linear
3434
simplification
35-
--simplification_substitution Outputs the substitution in json format
35+
--simplification_substitution Outputs the substitution in the simplification phase in json format
3636
-h, --help Prints help information
3737
-V, --version Prints version information
3838

mkdocs/docs/getting-started/installation.md

Lines changed: 34 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -61,32 +61,40 @@ Now, you should be able to see all the options of the executable by using the `h
6161
```console
6262
circom --help
6363

64-
Circom Compiler 2.0.0
65-
IDEN3
66-
Compiler for the Circom programming language
67-
68-
USAGE:
69-
circom [FLAGS] [OPTIONS] [input]
70-
71-
FLAGS:
72-
-h, --help Prints help information
73-
--inspect Does an additional check over the constraints produced
74-
--O0 No simplification is applied
75-
-c, --c Compiles the circuit to c
76-
--json outputs the constraints in json format
77-
--r1cs outputs the constraints in r1cs format
78-
--sym outputs witness in sym format
79-
--wasm Compiles the circuit to wasm
80-
--wat Compiles the circuit to wat
81-
--O1 Only applies var to var and var to constant simplification
82-
-V, --version Prints version information
83-
84-
OPTIONS:
85-
--O2 <full_simplification> Full constraint simplification [default: full]
86-
-o, --output <output> Path to the directory where the output will be written [default: .]
87-
88-
ARGS:
89-
<input> Path to a circuit with a main component [default: ./circuit.circom]
64+
circom compiler 2.1.7
65+
IDEN3
66+
Compiler for the circom programming language
67+
68+
USAGE:
69+
circom [FLAGS] [OPTIONS] [--] [input]
70+
71+
FLAGS:
72+
--r1cs Outputs the constraints in r1cs format
73+
--sym Outputs witness in sym format
74+
--wasm Compiles the circuit to wasm
75+
--json Outputs the constraints in json format
76+
--wat Compiles the circuit to wat
77+
-c, --c Compiles the circuit to c
78+
--O0 No simplification is applied
79+
--O1 Only applies signal to signal and signal to constant simplification
80+
--O2 Full constraint simplification
81+
--verbose Shows logs during compilation
82+
--inspect Does an additional check over the constraints produced
83+
--use_old_simplification_heuristics Applies the old version of the heuristics when performing linear
84+
simplification
85+
--simplification_substitution Outputs the substitution applied in the simplification phase in json format
86+
-h, --help Prints help information
87+
-V, --version Prints version information
88+
89+
OPTIONS:
90+
-o, --output <output> Path to the directory where the output will be written [default: .]
91+
-p, --prime <prime> To choose the prime number to use to generate the circuit. Receives the
92+
name of the curve (bn128, bls12381, goldilocks, grumpkin, secq256r1, pallas, vesta) [default: bn128]
93+
-l <link_libraries>... Adds directory to library search path
94+
--O2round <simplification_rounds> Maximum number of rounds of the simplification process
95+
96+
ARGS:
97+
<input> Path to a circuit with a main component [default: ./circuit.circom]
9098
```
9199

92100
## Installing snarkjs <a id="installing-the-tools"></a>

0 commit comments

Comments
 (0)