kdrag.theories.option
Algebraic data type for optional values
Functions
|
Helper to create Option None_ values >>> None_(smt.IntSort()) None_ |
|
Get the value of an Option, or a default value if it is None_ >>> get(kd.Some(42), 0) If(is(Some, Some(42)), val(Some(42)), 0) |
|
Check if a value is an Option >>> is_option(kd.Some(42)) True >>> is_option(42) False |
- kdrag.theories.option.None_(T: SortRef) DatatypeRef
Helper to create Option None_ values >>> None_(smt.IntSort()) None_
- Parameters:
T (SortRef)
- Return type:
DatatypeRef
- kdrag.theories.option.get(x: DatatypeRef, default: ExprRef) ExprRef
Get the value of an Option, or a default value if it is None_ >>> get(kd.Some(42), 0) If(is(Some, Some(42)), val(Some(42)), 0)
- Parameters:
x (DatatypeRef)
default (ExprRef)
- Return type:
ExprRef
- kdrag.theories.option.is_option(x: DatatypeRef) bool
Check if a value is an Option >>> is_option(kd.Some(42)) True >>> is_option(42) False
- Parameters:
x (DatatypeRef)
- Return type:
bool