Keyword: attribute
An attribute declares some practical aspect of the way an object is treated by the various Ivy commands. Typically these relate to code extraction.
Attributes may name a dot-separated object name prefix, in which case they apply only to the named object. If there is no prefix provided, they apply the object enclosing their declaration.
The following attributes are currently supported:
weight
: provides (as a double-quoted string) a floating-point weight between"0"
and"1"
that biases the execution of actions in an extracted randomized tester (as generated by ivy_to_cpp command)test
: provides the name of an object to generate tests for, in an extracted randomized tester.method
: specifies the preferred method of verifying an isolate. Equivalent to passing themethod
option on the command-line to ivy_check.separate
: controls theory separation in model checking when usingmethod=mc
iterable
: instructs code extraction to iterate over values of an uninterpreted typet
in generated code by calling functionst.iter.create(int)
,t.iter.is_end(int)
, andt.iter.next(int)
.cardinality
: instructs code extraction to calculate the cardinality of an uninterpreted typet
in generated code by consulting variablet.cardinality
, which should be an integer.radix
: controls the output formatting of trace messages in extracted code. The only legal non-default value is16
, which causes printing in hexadecimal.override
: specifies a sort to interpret an uninterpreted type as during code extraction.cppstd
: specifies the C++ standard used in code extraction, the only legal non-default action is the symbolcpp11
libspec
: specifies a comma-separated list of libraries to link with the system linker when linking extracted codemacro_finder
: equivalent to passing themacro_finder
option to ivy_check
Example:
object t = {
attribute cardinality = 5
attribute method = mc
}
attribute t.weight = "0.1"