B4) Flags and Decremental Weights
Dynamic Control
What if a grammar could count, remember, and exhaust itself?
Where does this article fit in?
Previous articles laid the groundwork: B1 for controlled randomness, B2 for building blocks, B3 for the five modes. But all of this remains static: weights don’t change, rules apply blindly. This article introduces the two mechanisms that make BP3 (Bol Processor 3, I2) truly dynamic: flags (conditional counters) and decremental weights. These are what allow modeling the exhaustion of a musical idea, the progressive end of a development, or the conditional execution of a passage. The formalization relies on the configurations and inference rules of L6.
Why is this important?
Imagine a musician improvising on an Indian raga (a melodic framework prescribing the notes, ornaments, and atmosphere of a piece). They explore a melodic motif, repeat it, vary it — then let it die out naturally to move on to something else. This is not random: the musician mentally counts, decides when a motif has been sufficiently explored, and controls the transition. It is precisely this type of dynamic control that Bernard Bel and James Kippen sought to model by creating BP3’s flags and weights [BelKippen1992a], based on their observation of tabla masters from the Lucknow gharānā [Kippen1988].
A classical probabilistic grammar (B1 — Probabilistic Context-Free Grammar) cannot do this. Its probabilities are fixed: the same rule always has the same chance of being chosen, whether it’s the first or the hundredth time. It’s like an ordinary die: it has no memory.
BP3 solves this problem with two complementary mechanisms:
- Flags: named counters that can be tested, incremented, or decremented. They allow saying “apply this rule only if the
avart(remaining cycles) counter is greater than 0, and decrement it.” - Decremental weights: weights that decrease with each use. They allow saying “this rule is very probable at first, but gradually exhausts itself.”
Flags are logical guards (yes/no), decremental weights are probabilistic guards (increasingly improbable). Together, they give BP3 an expressiveness that far exceeds classical grammars.
The idea in one sentence
Flags are conditional counters that control rule applicability, and decremental weights are probabilities that erode with each use, allowing BP3 to model the progressive exhaustion of a musical motif.
Let’s explain step by step
1. Flags: Conditional Counters
What is a flag?
A flag is a named variable, attached to a grammar rule, which serves two purposes: to condition the application of the rule and to modify the system’s state after application.
Sidebar: The Restaurant Counter Analogy
Imagine a restaurant offering a special menu: “First 20 orders half price.” The waiter keeps a counter:
- At the start: counter = 20
- For each special order: counter = counter – 1
- When counter = 0: “Sorry, the offer is over”
BP3 flags work exactly like this. The
avartcounter starts at 4 (number of tāla cycles to play), each cycle decrements it, and when it reaches 0, the variations stop.
BP3 Syntax
Flags appear between slashes / in rules:
gram#1[1] /avart=4/ |S| --> |A| |S|
gram#1[2] |S| --> -
gram#1[3] /avart/ |A| --> dha dhin dhin dha /avart-1/
gram#1[4] |A| --> tin ta -
This grammar plays 4 cycles (āvart) of the tintāl theka (dha dhin dhin dha), then stops. When the cycles are exhausted, only the dry motif (tin ta -) remains available. Let’s break down the flags:
/avart=4/: initializes theavartflag to 4 (number of remaining cycles)/avart/: tests that theavartflag is non-zero (> 0)/avart-1/: decrements theavartflag by 1 after each cycle
The Six Operators
BP3 offers six operators to manipulate flags:
| Operator | BP3 Syntax | Meaning | Example |
|---|---|---|---|
| (empty) | /avart/ |
Tests if the flag is non-zero (> 0) | Guard: apply only if avart > 0 |
= |
/avart=4/ |
Assigns a value | Initialization or reset |
+ |
/cycle+1/ |
Increments | Increases the counter |
- |
/avart-1/ |
Decrements | Decreases the counter |
> |
/avart>2/ |
Tests if strictly greater than | Conditional guard |
< |
/phase<5/ |
Tests if strictly less than | Conditional guard |
Operators are divided into two categories:
- Guards (conditions):
""(non-zero test),>,<— they decide if the rule can apply - Effects (operations):
=,+,-— they modify the state after application
The Flag AST Node
In the AST (Abstract Syntax Tree — see L4) of the BP2SC (Bol Processor to I3) transpiler (source-to-source compiler — see B7), a flag is represented by the node:
@dataclass
class Flag:
name: str # "avart", "phrase", "reprise"
op: str = "" # "", "=", "+", "-", ">", "<"
value: str | None = None # "20", "1", None (for simple test)
The op field is an empty string for the non-zero test (the /avart/ case without an explicit operator). The value field is None when no value is needed (simple test).
SOS Rule: Flag-Cond
The formal semantics of flags are expressed as an inference rule in L6. A configuration now includes a flag environment φ (phi) that associates each flag name with its current integer value.
Sidebar: SOS Reminder
In Structural Operational Semantics (L6), program behavior is described by inference rules of the form:
premise(s) ─────────────────── (Rule-Name) conclusion
The conclusion applies only if all premises are satisfied. Configurations
(σ, φ, t)represent: the working string σ (sigma), the flag environment φ, and time t.
Here is the Flag-Cond rule for a conditional flag with decrement:
φ(avart) > 0 r = (/avart/ A → β /avart-1/)
─────────────────────────────────────────────────────── (Flag-Cond)
(σ₁ . A . σ₂, φ, t) ⟹ (σ₁ . β . σ₂, φ[avart ↦ φ(avart) - 1], t)
Reading this rule:
- Premise 1: the current value of the
avartflag in environment φ is strictly positive - Premise 2: there exists a rule
rthat has/avart/as a guard and/avart-1/as an effect - Conclusion:
Ais replaced by β (beta, the right-hand side of the rule) in the working string, and the environment is updated by decrementingavartby 1
The notation φ[avart ↦ φ(avart) - 1] means “the same environment φ, except that the value of avart is replaced by its current value minus 1.” This is a functional update: the old environment is not modified, a new one is created.
What happens when the flag reaches 0?
The premise φ(avart) > 0 is no longer satisfied. The rule can no longer apply. If another rule for the same non-terminal (symbol that can still be derived, denoted between bars |A| in BP3 — see B2) exists without a guard (like rule 4 in our example), it takes over. Otherwise, the derivation blocks.
2. Decremental Weights
What is a decremental weight?
A decremental weight is a rule weight (like those seen in B1) that decreases each time the rule is chosen. The BP3 notation is <N-M>: initial weight N, decremented by M with each use.
Sidebar: The Soloist Who Tires Analogy
Imagine a jam session. At first, a musician raises their hand every turn to take a solo — they are enthusiastic, almost certain to be chosen (high probability). But with each solo played, their desire decreases: they raise their hand less often (low probability), then eventually remain seated (zero probability). The musician is still there, and if chosen, would play as well as before — but they no longer volunteer.
This is exactly what a decremental weight does: the rule always produces the same result when chosen, but its probability of being chosen decreases until it reaches zero.
BP3 Syntax
gram#1[1] |S| --> <50-12> |A| |S|
gram#1[2] |S| --> <1> fin
<50-12>: initial weight 50, decremented by 12 with each use<1>: fixed weight 1 (no decrement)
The Weight AST Node
@dataclass
class Weight:
value: int # 50 (initial weight)
decrement: int | None = None # 12 (decrement per use), None if fixed
When decrement is None, the weight is static (as in a classical PCFG). When it is defined, the weight evolves dynamically.
SOS Rule: Weight-Dec
Let’s formalize the semantics of decremental weights. The configuration is enriched with a weight function w that associates each rule with its current weight:
Let w be the weight function, initially w(r) = 50
Rule r chosen according to categorical distribution on w
────────────────────────────────────────────────────── (Weight-Dec)
(σ, φ, t, w) ⟹ (σ', φ, t, w[r ↦ max(0, w(r) - 12)])
Reading:
- Rule
ris chosen according to a categorical distribution (weighted draw) based on the current weights - After application, the weight of
ris decreased by 12, with a floor of 0 (the weight never becomes negative) - Flags φ and time t are not affected
Sidebar: Categorical Distribution
A categorical distribution (also called a discrete Gibbs distribution) is the generalization of a die roll to any number of faces with arbitrary probabilities. If we have three rules with weights [50, 10, 1], the probabilities are:
- P(rule 1) = 50 / (50 + 10 + 1) = 82%
- P(rule 2) = 10 / 61 = 16%
- P(rule 3) = 1 / 61 = 2%
The key point: probabilities are recalculated at each step, because weights change. This is not a one-time calculation, but a continuous recalculation. It is this continuous renormalization that distinguishes decremental weights from a PCFG.
Evolution of Probabilities: A Concrete Example
Let’s revisit the example:
gram#1[1] |S| --> <50-12> |A| |S|
gram#1[2] |S| --> <1> fin
| Use | Weight of r1 | Weight of r2 | P(continue) | P(finish) |
|---|---|---|---|---|
| 1 | 50 | 1 | 98.0% | 2.0% |
| 2 | 38 | 1 | 97.4% | 2.6% |
| 3 | 26 | 1 | 96.3% | 3.7% |
| 4 | 14 | 1 | 93.3% | 6.7% |
| 5 | 2 | 1 | 66.7% | 33.3% |
| 6 | 0 | 1 | 0.0% | 100.0% |
Let’s observe the profile: the first four uses are almost certain (the recursive rule largely dominates). Then the fifth use shifts abruptly — the probability of continuing drops to 67%. And by the sixth, the recursive rule is dead: the weight has fallen to 0.
Convergence and guaranteed termination: unlike a pure PCFG where recursion can theoretically last indefinitely, decremental weights guarantee termination. In at most ceil(N/M) + 1 uses (here ceil(50/12) + 1 = 6), the recursive rule reaches a weight of 0 and can no longer be chosen. This is a fundamental property for music: the composer knows that their motif will have a bounded length.
Sidebar: Decremental Weights vs. Flags
Both mechanisms control termination, but in different ways:
Aspect Flags Decremental Weights Type of control Logical (yes/no) Probabilistic (gradual) Transition Abrupt (active -> inactive) Progressive (from probable to impossible) Musical analogy “Stop after 20 notes” “The idea fades naturally” Expressiveness Deterministic structures Organic structures >
Flags are switches, decremental weights are dimmers.
3. Flag and Mode Interactions
Flags interact richly with the B3. The two most important combinations are RND + flags and ORD + flags.
RND with Flags: Conditional Choice
In RND (weighted random — see the five modes in B3) mode, flags transform random choice into conditional choice: the rule is eligible only if its guards are satisfied.
-mo.RND
gram#1[1] /avart=8/ |S| --> |A| |S|
gram#1[2] /avart/ |A| --> dha dhin dhin dha /avart-1/
gram#1[3] |A| --> tin ta -
The /avart=8/ flag initializes a counter to 8. As long as avart > 0, rule 2 is eligible and decrements the counter. When it reaches 0, only rule 3 (without a guard) remains available. The BP2SC transpiler translates this combination into a SuperCollider Prout — see the detailed translation in B8 §1.
ORD with Flags: Sequential Conditional Execution
In ORD (sequential) mode, flags allow deterministic control: rules are tried in order, but only if their guards are satisfied. This is the equivalent of a cascade of if/else if/else.
-mo.ORD
gram#1[1] /reprise=1/ |S| --> |A| |S|
gram#1[2] |S| --> -
gram#1[3] /reprise>0/ |A| --> dha dhin /reprise-1/
gram#1[4] |A| --> tin ta
Here, the reprise flag controls whether rule 3 is available. Once reprise is decremented to 0, rule 4 (without a guard) takes over. In ORD mode, this logic is purely sequential and deterministic.
Decremental Weights in RND Mode
Decremental weights in RND mode are translated into SC by a Prout with mutable local weight variables and a weighted selection recalculated at each iteration:
-mo.RND
gram#1[1] |S| --> <50-12> |A| |S|
gram#1[2] |S| --> <1> fin
At each iteration, a random draw is made based on the total current weights. The weight of rule 1 decreases by 12 with each use (bounded at 0), while the fixed weight of rule 2 does not change — it eventually dominates. See the detailed SuperCollider translation in B8 §1.
4. Concrete Examples
Example 1: Mohanam — The Raga with Controlled Exhaustion
The Mohanam raga is an Indian pentatonic (five-note) raga (Sa Ri Ga Pa Dha) used in many Carnatic compositions (classical tradition of South India). Here’s how BP3 can model the progressive exploration and then exhaustion of a motif:
-al.Mohanam
Sa Ri Ga Pa Dha
-mo.RND
gram#1[1] /phrase=20/ |S| --> |Phrase| |S|
gram#1[2] |S| --> |Cadence|
gram#1[3] /phrase/ |Phrase| --> |Motif| |Motif| /phrase-1/
gram#1[4] |Phrase| --> |Repos|
gram#1[5] |Motif| --> Sa Ri Ga
gram#1[6] |Motif| --> Pa Dha Pa
gram#1[7] |Motif| --> Ga Ri Sa
gram#1[8] |Repos| --> - - -
gram#1[9] |Cadence| --> Dha Pa Ga Ri Sa
Behavior Analysis:
- The
phraseflag starts at 20. As long as it is positive, phrases contain melodic motifs (rule 3). Each phrase decrementsphraseby 1. - When
phrasereaches 0, rule 3 stops applying. Only rule 4 remains: rests. - Finally, the recursion of
|S|eventually chooses rule 2 (the final cadence).
The musical result: active exploration for about 20 phrases, then a slowdown with silences, then a conclusive cadence. This is a model of the alapana (introductory exploration) of a raga.
Sidebar: Vādi and Samvādi — The Dominant Notes of the Raga
In the Mohanam raga (Sa Ri Ga Pa Dha), not all notes have the same weight. The vādi note (dominant note, the most important) is Pa and the samvādi note (sub-dominant note) is Sa. A flag could model this hierarchy:
gram#1[10] /vadi/ |Motif| --> Pa |Ornement| Pa /vadi-1/
The
/vadi/flag would ensure that Pa (the vādi) appears regularly in the melody — exactly as an Indian musician naturally returns to the dominant note of the raga. This structural constraint, impossible in a classical PCFG, is at the heart of what Bel and Kippen sought to formalize [BelKippen1992a].
Sidebar: The Ālāp — When Flags Reach Their Limits
The ālāp (opening of a raga where notes are introduced progressively: first Sa alone, then Sa-Re, then Sa-Re-Ga…) poses an interesting challenge. Can it be modeled with flags? Yes, but laboriously:
gram#1[1] /phase=1/ |Phrase| --> Sa Sa Sa /phase+1/ gram#1[2] /phase=2/ |Phrase| --> Sa Re Sa Re /phase+1/ gram#1[3] /phase=3/ |Phrase| --> Sa Re Ga Re Sa /phase+1/ gram#1[4] /phase=4/ |Phrase| --> Sa Re Ga Ma Ga Re Sa /phase+1/
This works, but it requires one rule per note introduced — enumerating cases instead of generating them. The ālāp reveals that flags are counters, not accumulators: they know how many notes have been introduced, but not which ones. For a more elegant solution, the context markers of B6 allow writing “play this note only if the previous notes are already present” — an accumulation constraint that only BP3’s context-sensitive extensions can express naturally.
Example 2: Progressive Exhaustion with Decremental Weights
Let’s visualize the evolution of probabilities for a richer grammar:
gram#1[1] |S| --> <40-8> |Thème| |S|
gram#1[2] |S| --> <10-2> |Variation| |S|
gram#1[3] |S| --> <1> |Coda|
| Step | w(Theme) | w(Variation) | w(Coda) | P(Theme) | P(Variation) | P(Coda) |
|---|---|---|---|---|---|---|
| 1 | 40 | 10 | 1 | 78.4% | 19.6% | 2.0% |
| 2 | 32 | 8 | 1 | 78.0% | 19.5% | 2.4% |
| 3 | 24 | 6 | 1 | 77.4% | 19.4% | 3.2% |
| 4 | 16 | 4 | 1 | 76.2% | 19.0% | 4.8% |
| 5 | 8 | 2 | 1 | 72.7% | 18.2% | 9.1% |
| 6 | 0 | 0 | 1 | 0.0% | 0.0% | 100.0% |
This table reveals expressive behavior:
- Exposition Phase (steps 1-3): the theme largely dominates, variations are possible but rare, the coda is almost impossible.
- Transition Phase (steps 4-5): the theme gradually weakens, variations maintain their relative proportion, the coda becomes conceivable.
- Conclusion Phase (step 6): both recursive rules are dead (weight 0). Only the coda remains: it is forced.
This is a model of the classical musical form Exposition-Development-Conclusion, emerging naturally from decremental weights without any explicit programming of the structure.
Sidebar: The Beauty of Decremental Weights
Note that both recursive rules exhaust themselves at the same time (step 6), because 40/8 = 10/2 = 5 uses before reaching 0. This is not a coincidence: the composer calibrated the N/M ratios to synchronize the exhaustions. A higher ratio (like
<40-4>) would extend the theme’s life to 10 uses, creating a longer piece.
Example 3: Kayda with Flag Control — Tāla Cycles
A kayda is a tabla composition structured in cycles (āvart) of tāla. The composer-performer plays a determined number of variation cycles before concluding with a tihāī (cadence). Flags naturally model this cycle counting:
-mo.RND
gram#1[1] /avart=4/ |S| --> |Cycle| |S|
gram#1[2] |S| --> |Tihai|
gram#1[3] /avart/ |Cycle| --> |Variation| |Variation| /avart-1/
gram#1[4] |Cycle| --> |Theka|
gram#1[5] |Variation| --> dha tirakita dhin dhin dha
gram#1[6] |Variation| --> dha dhin tirakita ta tirakita dhin
gram#1[7] |Theka| --> dha dhin dhin dha dha dhin dhin dha
gram#1[8] |Tihai| --> dha tirakita dhin - dha tirakita dhin - dha tirakita dhin
The /avart=4/ flag allows exactly 4 cycles (āvart) of variations (rule 3). When the counter reaches 0, only rule 4 (simple theka) remains available, then the grammar converges to the tihāī (rule 8). This is a faithful modeling of a kayda’s structure: theme → variations over N cycles → final cadence [BelKippen1992a].
Flag + Weight Interaction: Two-Level Control
Flags and weights can coexist in the same grammar, offering two-level control:
gram#1[1] /avart=15/ |S| --> <30-6> |A| |S| /avart-1/
gram#1[2] |S| --> <1> -
Here, rule 1 has two guards:
- The
avartflag must be > 0 (logical guard) - The decremental weight
<30-6>makes the rule less and less probable (probabilistic guard)
The first of the two to exhaust itself stops the recursion. With avart=15 (exhaustion in 15 steps) and <30-6> (exhaustion in 5 steps), the weight wins: the recursion will probably stop around 5 iterations, well before the flag reaches 0.
This dual control allows defining a hard limit (the flag: at most 15 iterations, never more) and a soft tendency (the weight: on average 4-5 iterations, with variation).
5. Expressive Power of Decremental Weights
Decremental weights are linear (<N-M> subtracts M at each step) — there is no exponential or logarithmic decay. But this simple mechanism produces rich behaviors thanks to renormalization and the combinatorial interaction between rules.
Implicit Increment by Renormalization
The first counter-intuitive observation: decrementing one rule increments the others. If two rules have weights [50, 1] and only the first decrements, the second goes from P = 1/51 = 2% to P = 1/3 = 33% without its weight having changed. Decremental weights thus offer incremental control for free — simply decrement what you want to see disappear.
Single Shot: <1-1>
A <1-1> weight cancels itself after a single use. This is a one-time event: the rule can trigger at most once, then disappears. Useful for an introduction, a harmonic surprise, or an ornament that should not be repeated:
gram#1[1] |S| --> <1-1> |Surprise| |S|
gram#1[2] |S| --> <5> |Normal| |S|
gram#1[3] |S| --> <1> -
The surprise has a chance to occur at the beginning (1/7 ≈ 14%), then cannot return.
Immortal Anchor: <N> without Decrement
A fixed-weight rule never dies. When all others exhaust themselves, it becomes the sole survivor — an attractor towards which the grammar inevitably converges. This is the role of the Coda in the Theme/Variation/Coda example: its <1> weight does not move, but its probability grows to 100%.
Synchronized vs. Staggered Death
The N/M ratio determines a rule’s lifespan: ceil(N/M) steps. By calibrating the ratios, one controls the temporal shape of the piece:
| Strategy | Ratios | Musical Effect |
|---|---|---|
| Synchronized Death | <40-8> and <10-2> (ratio 5 and 5) |
Theme and variation die together → abrupt coda |
| Staggered Death | <40-8> and <50-2> (ratio 5 and 25) |
The theme dies, the variation survives for a long time → gradual transition |
| Succession | <10-5>, <30-3>, <1> (ratio 2, 10, ∞) |
First motif A dominates, then B takes over, then C inherits |
Succession is particularly interesting: it creates a relay form where behaviors pass the torch, without any explicit programming of the temporal structure.
Non-Linear Relationship Between Rules
Each weight decrements linearly, but the ratio between two weights evolves non-linearly. If A has <100-10> and B has <50-2>:
| Step | w(A) | w(B) | Ratio A/B |
|---|---|---|---|
| 1 | 100 | 50 | 2.0 |
| 3 | 80 | 46 | 1.7 |
| 5 | 60 | 42 | 1.4 |
| 7 | 40 | 38 | 1.05 |
| 9 | 20 | 34 | 0.59 |
| 11 | 0 | 30 | 0.0 |
The ratio goes from 2.0 to 0 — A dominates first, then B takes over. The ratio curve is non-linear (it accelerates towards the end) even if individual decrements are constant. Two straight lines descending at different speeds produce a curved ratio.
Phase Transition
An extreme ratio between weight and decrement creates an abrupt switch rather than a gradual fade:
<100-99>: P ≈ 99% for 1 step, then 0% → switch<100-10>: P ≈ 90%+ for 9 steps, then drops → plateau + cliff<100-1>: P decreases very slowly over 100 steps → long fade
The composer chooses the form of the transition by calibrating the N/M ratio.
Limitation: Linear Profile Only
Despite this combinatorial richness, the decline of each individual rule remains strictly linear. A true exponential decline (division by 2 at each step) or logarithmic decline (rapid decline then plateau) is not expressible. This limitation does not change formal expressiveness (an exponential weight remains context-free), but it restricts the palette of temporal profiles available to the composer.
Key Takeaways
- Flags are named conditional counters, manipulated by six operators: test (
""), assignment (=), increment (+), decrement (-), greater than (>), less than (<). - Flags are divided into guards (conditions for applicability) and effects (state modifications).
- Decremental weights
<N-M>decrease by M with each use, reaching 0 in ceil(N/M) steps, which guarantees termination of recursions. - The categorical distribution is renormalized at each step: probabilities are dynamically recalculated, which fundamentally distinguishes BP3 from PCFGs.
- In SuperCollider, BP2SC translates flags into
Proutwithif/elsestructures and decremental weights into mutable local variables — see B8 for SC code examples. - Flags offer logical control (switch), decremental weights offer probabilistic control (dimmer). Combined, they allow two-level control.
- Direction: this article describes flags and weights in the sense of production. In analytical (ANAL) mode, weights play an inverse role: each rule used to recognize a sequence sees its weight incremented, which constitutes an integrated learning mechanism. Flags, meanwhile, serve to trace the analytical path. See B8.
Further Reading
- BP3 Documentation: Bol Processor — Flags and Conditions
- Dynamic Weights: Bol Processor — Grammar Control
- PCFG and Beyond: Lari & Young (1990), “The estimation of stochastic context-free grammars using the Inside-Outside algorithm” — to understand why classical PCFGs are not sufficient for dynamic control
- Non-Markovian Stochastic Processes: Feller, An Introduction to Probability Theory and Its Applications, vol. 2, chapter on processes with memory
- Raga and Controlled Improvisation: Subramanian (2007), “Generative Grammar of Carnatic Music” — a grammatical model of raga improvisation
- The Foundational Article: Bel, B. & Kippen, J. (1992), “Modelling Music with Grammars: Formal Language Representation in the Bol Processor” — flags and weights applied to tabla
- The Ethnomusicological Context: Kippen, J. (1988), The Tabla of Lucknow: A Cultural Analysis of a Musical Tradition, Cambridge University Press
- Flags and Weights in Analytical Mode: B8 — how flags and weights work in BP3’s ANAL and TEMP directions
Glossary
- Ālāp: Opening of a raga where notes are introduced progressively (Sa, then Sa-Re, then Sa-Re-Ga…). Its accumulative structure exceeds the capabilities of flags (counters) and requires BP3’s context-sensitive extensions (B6).
- Categorical (distribution): Discrete probability distribution over a finite set of categories, each with its own weight. Generalizes a loaded die roll to an arbitrary number of faces.
- Configuration (SOS): Tuple representing the complete state of the system during derivation. For BP3 with flags and weights: (σ, φ, t, w) — working string, flag environment, time, weight function.
- Āvart: A complete cycle of tāla. A kayda can extend over several āvart before concluding with a tihāī.
- Convergence: Property of a process that tends towards a final state. Decremental weights converge to 0, forcing termination.
- Decrement: Decrease in a value. In
<50-12>, the decrement is 12: the weight loses 12 with each use. - Flag Environment (φ): Function that associates each flag name with its current integer value. Notation: φ(avart) = 4.
- Flag: Named variable attached to BP3 rules, serving as a conditional counter. Can be tested, assigned, incremented, or decremented.
- Guard: Condition that must be satisfied for a rule to apply. Flags in test mode (
/avart/,/avart>2/) function as guards. - Functional Update: Operation that creates a new environment identical to the old one except for one variable. Notation: φ[avart ↦ 3] means “φ with avart changed to 3.”
- Decremental Weight: Weight associated with a rule that decreases after each use of that rule. BP3 notation:
<N-M>(initial weight N, decrement M). - Renormalization: Recalculation of probabilities after weight modification. If weights change from [50, 1] to [38, 1], probabilities are recalculated from [98%, 2%] to [97.4%, 2.6%].
- Kayda: Tabla composition with a fixed theme (mukhra) and systematic variations over several tāla cycles, concluding with a tihāī.
- Guaranteed Termination: Property of a system that necessarily reaches a final state in a finite number of steps. Decremental weights guarantee a maximum of ceil(N/M) + 1 steps.
- Tihāī: Indian cadence where a motif is repeated exactly three times to land on sam (the first beat of the cycle).
- Vādi: Dominant note of a raga, the most frequent and important. Its regular presence can be modeled by a BP3 flag.
Prerequisites: B1, B3, L6
Reading Time: 12 min
Tags: #flags #weights #control #BP3 #stochastic #SOS