Skip to content

Latest commit

 

History

History
16 lines (11 loc) · 1.15 KB

sv_manage.md

File metadata and controls

16 lines (11 loc) · 1.15 KB

Semantic Variable Management

Semantic Variable management focuses on the generation and assignment of different Variable ids.

Namespace

A Semantic Variable namespace is just a id generator. Parrot ensures that Variable ids will not have duplicate names within the same namespace. Overall, there are two kinds of namespaces in the Semantic Variable manager:

  • Global namespace, a.k.a. the namespace for Constant Prefix variables.
  • Local namespace of each Session.

Generate id

The Semantic Variable manager is responsible for assigning a Semantic Variable to each node in a RequestChain (See Graph). The manager has different treatments for different node types:

  • ConstantFill: To ensure consistency in management, we have also assigned Semantic Variables to constant text (not just to input/output fields). The id of this type of nodes is generated by hashing the text content itself, so that text chunks with the same content can reuse the Semantic Variable.
  • PlaceholderFill: This type of nodes must be already bound to an existing variable!
  • PlaceholderGen: We randomly generate a unique id (Hash by the given var_name).