sp1_recursion_compiler/ir/
var.rs1use super::{Builder, Config};
2
3pub trait Variable<C: Config>: Clone {
4 type Expression: From<Self>;
5
6 fn uninit(builder: &mut Builder<C>) -> Self;
7
8 fn assign(&self, src: Self::Expression, builder: &mut Builder<C>);
9
10 fn assert_eq(
11 lhs: impl Into<Self::Expression>,
12 rhs: impl Into<Self::Expression>,
13 builder: &mut Builder<C>,
14 );
15
16 fn assert_ne(
17 lhs: impl Into<Self::Expression>,
18 rhs: impl Into<Self::Expression>,
19 builder: &mut Builder<C>,
20 );
21}
22
23pub trait FromConstant<C: Config> {
24 type Constant;
25
26 fn constant(value: Self::Constant, builder: &mut Builder<C>) -> Self;
27}