Skip to content

Commit

Permalink
fix(bool.ts): update bool module
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinMinkov committed Jun 7, 2023
1 parent 1dbef9b commit a7dd4e9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/lib/bool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,15 @@ class Bool {
if (this.isConstant() && isConstant(y)) {
return new Bool(this.toBoolean() && toBoolean(y));
}
return new Bool(Snarky.bool.and_(this.value, Bool.#toVar(y)));
console.log('and_', Snarky.field, Snarky.bool);
return new Bool(Snarky.bool.and(this.value, Bool.#toVar(y)));
}

or(y: Bool | boolean): Bool {
if (this.isConstant() && isConstant(y)) {
return new Bool(this.toBoolean() || toBoolean(y));
}
return new Bool(Snarky.bool.or_(this.value, Bool.#toVar(y)));
return new Bool(Snarky.bool.or(this.value, Bool.#toVar(y)));
}

assertEquals(y: Bool | boolean, message?: string): void {
Expand Down
4 changes: 2 additions & 2 deletions src/snarky.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,9 @@ declare const Snarky: {
bool: {
not(x: BoolVar): BoolVar;

and_(x: BoolVar, y: BoolVar): BoolVar;
and(x: BoolVar, y: BoolVar): BoolVar;

or_(x: BoolVar, y: BoolVar): BoolVar;
or(x: BoolVar, y: BoolVar): BoolVar;

equals(x: BoolVar, y: BoolVar): BoolVar;

Expand Down

0 comments on commit a7dd4e9

Please sign in to comment.