- simple : vm_obj_kind
- constructor : vm_obj_kind
- closure : vm_obj_kind
- native_closure : vm_obj_kind
- mpz : vm_obj_kind
- name : vm_obj_kind
- level : vm_obj_kind
- expr : vm_obj_kind
- declaration : vm_obj_kind
- environment : vm_obj_kind
- tactic_state : vm_obj_kind
- format : vm_obj_kind
- options : vm_obj_kind
- other : vm_obj_kind
For simple and constructor vm_obj's, it returns the constructor tag/index. Return 0 otherwise.
For closure vm_obj's, it returns the internal function index.
For constructor vm_obj's, it returns the data stored in the object. For closure vm_obj's, it returns the local arguments captured by the closure.
For name vm_obj's, it returns the name wrapped by the vm_obj.
For level vm_obj's, it returns the universe level wrapped by the vm_obj.
For expr vm_obj's, it returns the expression wrapped by the vm_obj.
For declaration vm_obj's, it returns the declaration wrapped by the vm_obj.
For environment vm_obj's, it returns the environment wrapped by the vm_obj.
For tactic_state vm_obj's, it returns the tactic_state object wrapped by the vm_obj.
For format vm_obj's, it returns the format object wrapped by the vm_obj.
- bytecode : vm_decl_kind
- builtin : vm_decl_kind
- cfun : vm_decl_kind
Information for local variables and arguments on the VM stack. Remark: type is only available if it is a closed term at compilation time.
Internal function index associated with the given VM declaration.
Number of arguments needed to execute the given VM declaration.
Return .olean file where the given VM declaration was imported from.
Return names .olean file where the given VM declaration was imported from.
If the given declaration is overridden by another declaration using the vm_override attribute, then this returns the overriding declaration.
Returns the vm declaration associated with the given name. Remark: does _not_ return the vm_override if present.
Returns the vm declaration associated with the given index. Remark: does _not_ return the vm_override if present.
Return the vm_obj stored at the given position on the execution stack. It fails if position >= vm.stack_size
Return (name, type) for the object at the given position on the execution stack. It fails if position >= vm.stack_size. The name is anonymous if vm_obj is a transient value created by the compiler. Type information is only recorded if the type is a closed term at compilation time.
Pretty print the vm_obj at the given position on the execution stack.
Return the function name at the given stack frame. Action fails if position >= vm.call_stack_size.
- init : α
- step : α → vm α
A Lean VM monitor. Monitors are registered using the [vm_monitor] attribute.
If option 'debugger' is true, then the VM will initialize the vm_monitor state using the 'init' field, and will invoke the function 'step' before each instruction is invoked.