1. Language Fundamentals & Syntax
1.1 Lexical Structure & Conventions
Rave is a case-insensitive, textual, declarative programming language. Statements and definitions are delimited by semicolons ;. Comments follow standard C-style syntax:
Identifier naming conventions strictly distinguish variable references from keywords and properties:
- Variables are delimited by percent signs:
%variable_name%. - Keywords (external runtime inputs provided by the solver) are prefixed by context or qualified scopes:
leg.%start_utc%,keywords.%departure%. - Rules begin with the keyword
ruleand terminate withend.
1.2 Domain Data Types
Rave blends standard general-purpose data types with domain-specific temporal and geographical types tailored for airline operations:
| Type Category | Type Keyword | Description & Representation | Example Usage |
|---|---|---|---|
| General | int / integer |
32-bit or 64-bit signed integer values | 3, 142 |
| General | real / float |
Floating-point numbers for costs/weights | 1.5, 350.75 |
| General | bool / boolean |
Boolean truth values | True, False |
| General | string |
Textual string literals | "SAW", "Captain" |
| Domain Specific | time |
Clock time or absolute temporal stamp | 10:30, 24:00 |
| Domain Specific | duration |
Elapsed time duration (HH:MM or minutes) | 00:30, 05:15 |
| Domain Specific | datetime |
Combined calendar date and absolute time | 2026-08-11 14:00 |
| Domain Specific | airport |
3-letter IATA or 4-letter ICAO airport code | "LHR", "JFK", "SAW" |
1.3 Constants & Parameters
Constants and parameters establish fixed thresholds or configurable business rules.
Global Constants Block
Bounded Parameters
Parameters allow optimization analysts to perform "what-if" scenario testing without recompiling the core rule codebase:
1.4 Variables & Identifiers
Variables encapsulate intermediate computations. Because Rave is declarative, variables do not represent mutable memory cells; they define functional expressions bound to a specific context.
%leg_duration% = leg.%arrival_time% - leg.%departure_time%;
%duty_flight_time% = sum(leg(duty), %leg_duration%);