Triton is a virtual machine that comes with Algebraic Execution Tables (AET) and Arithmetic Intermediate Representations (AIR) for use in combination with a STARK proof system.
I'm writing some code in tasm-lib where I could use the ConstraintType enum for a convenient closure. As it looks now, I have to define a local enum type which is just a copy of ConstraintType. I guess I could also use a derivation of EnumCount on the ConstraintType.
I just wrote this code:
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash, EnumCount)]
enum ConstraintType {
Initial,
Consistency,
Transition,
Terminal,
}
let zerofier_inverse_pointer = library.kmalloc(
(EXTENSION_DEGREE * ConstraintType::COUNT)
.try_into()
.unwrap(),
);
let zerofier_write_address = |x: ConstraintType| {
zerofier_inverse_pointer
+ BFieldElement::new((EXTENSION_DEGREE * x as usize).try_into().unwrap())
};
I'm writing some code in
tasm-lib
where I could use theConstraintType
enum for a convenient closure. As it looks now, I have to define a local enum type which is just a copy ofConstraintType
. I guess I could also use a derivation ofEnumCount
on theConstraintType
.I just wrote this code: