Module rule

Source
Expand description

Agentic Inference Markup (AIM) Rules

This module defines the core Rule structure used in AIM workflows. A Rule represents a single entry in an AIM structure, consisting of an identifier, type definition, expression, and computed value.

§Rule Structure

rule_name: Type = expression @ value
formatted_name: Format = "Instruction" "Example1" "Example2"
evaluation_name: Eval = 80/100
_assignment: Number = @reference

§Categories

Rules fall into three categories based on their identifier format:

  • Standard rules: lowercase identifiers (e.g., temperature)
  • Modifier rules: all-uppercase identifiers (e.g., UNIT)
  • Assignment rules: identifiers starting with underscore (e.g., _result)

Structs§

Rule
A single rule in an AIM structure representing a workflow component

Functions§

is_lowercase
Check if a string contains only lowercase characters.
is_uppercase
Check if a string contains only uppercase characters.
parse_rule
Parse a rule from a string according to the AIM grammar.
test_for_assignment
Test if an identifier should be considered an assignment rule.
test_for_modifier
Test if an identifier should be considered a modifier rule.