Skip to content

Commit

Permalink
Merge pull request #193 from fasteater/master
Browse files Browse the repository at this point in the history
typos and grammar
  • Loading branch information
miguelis committed Jun 23, 2023
2 parents 878d675 + 15aa2ea commit 85a7760
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ template B(n){
}
component main = B(2);
```
Thanks to the use of anonymous components, we can easily write the next program, which is, equivalent to the previous one, but its code is much cleaner.
Thanks to anonymous components, we can make the above program much cleaner.

```text
template A(n){
Expand Down
2 changes: 1 addition & 1 deletion mkdocs/docs/circom-language/code-quality/code-assertion.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

**assert(bool_expression);**

This statement introduces conditions to be checked. Here, we distinguish two cases depending if **bool_expression** is unknown at compilation time:
This statement introduces conditions to be checked. Here, we distinguish two cases depending on if **bool_expression** is unknown at compilation time:

- If the assert statement depends on a control flow with only known conditions (see [Unknowns](../circom-insight/unknowns)) and the **bool_expression** is known (e.g., if it only depends on the value of template parameters or field constants), the assert is evaluated in compilation time. If the result of the evaluation is false, then the compilation fails. Consider the next piece of code:

Expand Down
4 changes: 2 additions & 2 deletions mkdocs/docs/circom-language/tags.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ template IsZero() {
To the light of this example, when using tags in intermediate or output signals, the programmer must use components like the previous one or explicitly include the constraints to guarantee the validity of the tags.

### Tags with value
Notice that in the previous template `Bits2Num`, we can add more information about the output signal `out`: the maximum number of bits needed to represent it is `n`. To express this fact is necessary that tags can have a value.
Notice that in the previous template `Bits2Num`, we can add more information about the output signal `out`: the maximum number of bits needed to represent it is `n`. To express this fact, it is necessary that tags can have a value.

The value of the tag can be accessed using the notation `.` at any moment as a part of an arithmetic expression. However, if the tag has not been previously initialized, then the compiler reports an error.

The value of the tag can be also modified using the notation `.`, as long as the corresponding signal has not received any value. Valued tags behave like parameters which means that they can only be assigned to values known at compilation time.
The value of the tag can also be modified using the notation `.`, as long as the corresponding signal has not received any value. Valued tags behave like parameters which means that they can only be assigned to values known at compilation time.

Let us modify the previous example to include this tag in the template.

Expand Down

0 comments on commit 85a7760

Please sign in to comment.