Skip to content

Commit

Permalink
lt circuit
Browse files Browse the repository at this point in the history
  • Loading branch information
ludns committed Nov 9, 2024
1 parent 2178088 commit 8c37f2f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pod2/src/pod/circuit/operation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ impl OperationTarget {
statement2_target,
statement3_target,
), // TODO: MaxOf
StatementTarget::lt(builder, statement1_target, statement2_target), // TODO: Lt
StatementTarget::not_equal(builder, statement1_target, statement2_target), // LtToNonequality. TODO.
];

// Indicators of whether the conditions on the operands were satisfied.
Expand Down Expand Up @@ -196,6 +198,8 @@ impl OperationTarget {
builder._true(), // TODO: SumOf
builder._true(), // TODO: ProductOf
builder._true(), // TODO: MaxOf
builder._true(), // TODO: Lt
builder._true(), // TODO: LtToNonequality
]
.iter()
.enumerate()
Expand Down
17 changes: 17 additions & 0 deletions pod2/src/pod/circuit/statement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,23 @@ impl StatementTarget {
}
}

pub fn lt(
builder: &mut CircuitBuilder<F, D>,
statement1_target: StatementTarget,
statement2_target: StatementTarget,
) -> Self {
Self {
predicate: builder.constant(Statement::LT),
origin1: statement1_target.origin1,
key1: statement1_target.key1,
origin2: statement2_target.origin1,
key2: statement2_target.key1,
origin3: OriginTarget::none(builder),
key3: builder.zero(),
value: builder.zero(),
}
}

pub fn from_entry(
builder: &mut CircuitBuilder<F, D>,
entry_target: &EntryTarget,
Expand Down

0 comments on commit 8c37f2f

Please sign in to comment.