Module evaluate

Source

Functionsยง

evaluate_binary
Evaluate a binary operation.
evaluate_unary
Evaluate a unary operation.
literal_to_value
prepare_snarkvm_string ๐Ÿ”’
resolve_unsuffixed_binary_op_operands ๐Ÿ”’
Resolves unsuffixed numeric operands for binary operations by inferring types based on the other operand, the operation type, and an optional expected type. Handles special cases for multiplication and exponentiation with additional logic for Group, Scalar, and Field type inference. Ensures that both operands are resolved to compatible types before evaluation. Returns a tuple of resolved Values or an error if resolution fails.
resolve_unsuffixed_unary_op_operand ๐Ÿ”’
Resolves an unsuffixed operand for a unary operation by inferring its type based on the operation and an optional expected type. Uses predefined types (Field or Group) for specific operations, otherwise defaults to the expected type if available. Returns the resolved Value or an error if type resolution fails.