4.3.5. Let Rule

Variable Definition Rule
[Tip]Description

The let rule (variable definition rule) is used for defining variablefor a given rule, typically for a sequential rule.

[Important]Syntax
LetRuleAST ::= let VariableDefinitionsAST in AsmRuleAST 
VariableDefinitionsAST ::= VariableDefinitionAST  
                         | VariableDefinitionsAST , VariableDefinitionAST 
	                      
VariableDefinitionAST ::= VariableDefAST TypeOptAST = ArithmeticTermAST 
[Note]Semantics

An ASM variable needs to be defined explicitly prior to its first use. A possible way of it is using the let rule.

The let rule defines a variable, initializes it with the value resulting from the evaluation of the ASM term and then calls its internal ASM rule. The variable is accessible inside the scope of the rule, i.e. only in its body ASM rule.

Defined In:  compound rule

See Also:  A variable can be defined also with the forall rule and the choose rule or as a parameter of an ASM rule.