rslc compiler.
E-CONCEPT-UNKNOWN
A concept type names a vocabulary concept. A concept type wraps a value’s type and says what the value is in the rating manual:Relativity(Factor), Subtotal(Premium), Exposure(Num). The check asks each concept to be a name from the rater’s vocabulary.
A rater that declares RSL 0.4.1 reads the rating@2 vocabulary, unless spec names another with vocabulary. One shared list of concepts lets every reader and every tool treat a Relativity the same way in every rater.
When the name is close to a concept, the help line gives that concept.
Example
The concept PolicyPremiums ends in a stray s. The vocabulary’s name is PolicyPremium.
Premium, with the concept left out, also passes.
- A table column’s concept type, such as
rate: BaseRates(Rate), gets the same message with the column’s name. Correct the concept there.
Complete files
Complete files
bad/rater.rsl
good/rater.rsl
E-CONCEPT-TARGET
A concept sits where its vocabulary allows. Each concept of the vocabulary describes inputs, calculations or both.Exposure describes both. PolicyPremium describes a calculation: a rater computes a premium, and a caller supplies facts. The check asks each concept type to sit on the kind of value it describes.
The check also asks for a concrete concept, written once as the outermost type of an input, a calculation or a table column.
Example
The input payroll takes PolicyPremium, a concept for calculations.
Exposure fits. The plain type Num also passes.
- The concept is abstract, such as
AmountorMultiplier. An abstract concept groups its children: use one of the children the help line lists. - A concept sits inside another type, as in
Subtotal(PolicyPremium(Premium)). Write one concept, outermost. - A table column takes a concept under
vocabulary: "rating@1". That vocabulary keeps concepts on inputs and calculations;rating@2accepts them on columns.
Complete files
Complete files
bad/rater.rsl
good/rater.rsl
E-CONCEPT-UNIT
A concept’s unit matches the value’s type. Each concept has a unit: money, ratio, delta, rate, number, category, flag or date. A value’s RSL type has a unit too.Premium is money, Factor and Pct are ratios, Bool is a flag and an enum is a category. The check asks the two units to agree.
A mismatch means the concept or the type is wrong, and either one misleads a reader of the rating manual. The help line lists concepts whose unit fits the type.
Example
The policy premium has the type Premium, which is money, and the ratio concept Relativity.
PolicyPremium describes the premium of the policy.
- The type is
Num, which leaves the unit to the formula, and the formula gives another unit.Relativity(Num) = self.manual_premium * 1.1is money under a ratio concept. Eligibilitysits on aFactor. A factor that is 1 for a valid request is a check: state it as an admission rule,where … [code: …].- A table column’s concept disagrees with the column’s type. Change the concept or the column type.
Complete files
Complete files
bad/rater.rsl
good/rater.rsl
E-CONCEPT-SHAPE
A concept’s formula has the concept’s shape. Some concepts promise a shape of formula. ARelativity is one filed factor. A Composite combines two or more factors. A MinimumPremium is applied with max, a MaximumPremium with min, and a Rounding holds a round. The check compares each of these concepts with the formula of its calculation.
The rating manual shows a value by its concept. A product called a Relativity sends a reviewer to the filing for one factor that the filing states as two.
Example
modification multiplies two factors and calls the product a Relativity.
Composite, as the help line says.
Compositesits on a single factor. UseRelativity.MinimumPremiumsits on a value that lacks amax(…). Apply the minimum withmax, in its own formula or in a calculation that reads it.MaximumPremiumsits on a value that lacks amin(…). Apply the maximum withminthe same way.Roundingsits on a formula that lacks around(…). Round the value, or use a concept such asSubtotal.
Complete files
Complete files
bad/rater.rsl
good/rater.rsl
E-UNIT-MIX
Arithmetic combines units that agree. The check follows units through every formula. APremium is money, a Factor or a Pct is a ratio, and a concept adds its own unit. Money times a ratio is money. Money plus a ratio mixes two units, so one operand or the operator is a mistake.
Both operands are numbers, so the formula has a value. The unit check catches the slip that the arithmetic allows.
The check runs on a rater that describes itself for the rating manual with a concept type, a label, a note or Stages.
Example
premium adds the experience modification to the base premium, where the manual multiplies.
max(…)ormin(…)compares money with a ratio. Compare two amounts or two ratios.- A formula multiplies money by money. Multiply an amount by a ratio, or divide two amounts for a ratio.
- A delta, such as a
ScheduleRatingcredit of -0.10, multiplies or adds to an amount directly. Apply it asamount * (1 + delta). - An admission rule mixes units in its
where. The message names the rule.
Complete files
Complete files
bad/rater.rsl
good/rater.rsl
E-STAGE-UNDECLARED
A step names a stage thatStages declares.
Stages lists the stages of the rating manual in order, each with a title: classification, base rates, factors, premium. A step joins a stage with step name in stage. The check asks each step to name a stage that Stages declares, and Stages to declare each stage once.
Stages let a reader follow the rater in the order the manual presents it. When the name is close to a declared stage, the help line gives that stage.
Example
The step joins premiums, and Stages declares premium.
- A step uses
inin a rater that lacks aStagessection. Declare the stage, as the help line shows. Stagesdeclares one stage twice. Keep one line for each stage.
Complete files
Complete files
bad/rater.rsl
good/rater.rsl
E-STAGE-MISSING
Every step joins a stage. A rater that declaresStages presents its whole calculation by stage. The check asks every step of every record to join a stage with in.
A step outside the stages falls out of the manual’s order, and a reader loses the place of its values. The help line lists the declared stages.
A step that lacks both a stage and a note of its own also gets E-NOTE-MISSING.
Example
The rater declares the stage premium, and the step rating lacks in.
in and the stage after the step’s name.
Complete files
Complete files
bad/rater.rsl
good/rater.rsl
E-STAGE-ORDER
A stage reads its own or earlier stages. The order ofStages is the order of the rating manual. The check asks each calculation to read values from its own stage or from an earlier one.
A reader then meets every value before the stage that uses it, as in a filed manual.
Example
Stages lists total first, and the premium of total reads payroll_premium from the later stage payroll.
Stages is right, move the misplaced step to another stage: the help line names both moves.
Complete files
Complete files
bad/rater.rsl
good/rater.rsl
E-GROUP
Acollect group needs a title and members.
collect gathers calculations into one row of the rating manual, under the calculation that heads the group. title names the row. A policy’s discounts are a typical group: the manual shows a row “Policy discounts” that opens to each discount.
The check asks each group for a title and for members that are calculations of the head’s record. Each calculation belongs to one group at most.
Example
premium collects payroll_premium and leaves the row unnamed.
title beside collect.
collectsits on an input. Write it on the calculation that heads the group.- A member is an input or a misspelt name. Name calculations of the head’s record.
- Two groups name the same calculation. Keep it in one of them.
Complete files
Complete files
bad/rater.rsl
good/rater.rsl
E-NOTE-MISSING
A step or its stage has a note. A note is one sentence that tells a reader what a step does. In a rater that declaresStages, the check asks every step for a note. The step’s own note counts, and so does the note of its stage.
The rating manual prints the sentence above the step’s values, so each part of the calculation opens with its purpose.
Example
The stage premium and its step rating both lack a note.
step rating in premium [note: "…"].
Complete files
Complete files
bad/rater.rsl
good/rater.rsl
E-NOTE-SENTENCE
A note is one short sentence. Anote on a stage, a step, a value, a record or a table is one sentence of at most 200 characters. The check counts the characters and looks for a second sentence: a full stop, exclamation mark or question mark followed by more text.
The rating manual prints a note beside the thing it describes. One sentence keeps the manual quick to scan, and cite points to the page with the detail.
Example
The note of the step rating holds two sentences.
- The note runs past 200 characters. Shorten it and leave the detail to the cited page.
Complete files
Complete files
bad/rater.rsl
good/rater.rsl
E-MEANING-KEY
A record’s brackets takelabel and note.
Brackets after a record’s name describe the record in the rating manual: Policy [label: "Policy", note: "…"]. The check asks those brackets to hold label and note only.
Other keys belong elsewhere. cite goes where a filed number is: on a value, a table, a constant or a stage. collect and title go on the calculation that heads a group.
Example
The record Policy carries a cite.
cite from the record’s brackets. The premium below already cites the page.
Complete files
Complete files
bad/rater.rsl
good/rater.rsl
E-ROUND-SPLIT
A rounding stays with its arithmetic. The rating manual shows a calculated value as arithmetic over named values, and shows its rounding as part of that value. The check finds a calculation whose whole formula isround(self.x, …), where that round is the only reader of x.
Such a pair turns one filed step into two rows. The unrounded row has a name that only the rounding uses.
A value that another calculation or a rating outcome also reads keeps its own row. The check covers every rater that declares RSL 0.4.1 or later.
Example
manual_premium holds the arithmetic, and premium only rounds it.
Complete files
Complete files
bad/rater.rsl
good/rater.rsl
E-MAX-BRANCH
Write the larger of two values withmax.
The rating manual shows an if as a condition of the filed rule, and shows max or min as one value. The check finds an if that compares two values and returns one of them: if a > b then a else b. That is max(a, b).
Written with max, a minimum premium reads as a minimum premium. The check covers >, >=, < and <=, and gives min where the smaller value wins.
The check covers every rater that declares RSL 0.4.1 or later.
Example
premium applies the minimum premium with an if.
max that the help line gives.
Complete files
Complete files
bad/rater.rsl
good/rater.rsl
E-CHAIN
Arithmetic reads named values. The rating manual shows a calculation as a chain: named values joined by one operator, such as base rate times territory factor times class factor. The check asks each operand of a calculation’s arithmetic to be a value a reader can name. Inputs, constants, numbers and other calculations qualify, and so does arithmetic over them. An inline lookup,if, max, min or round among the operands is a step of the filing with its name left out. Give it a name, and the manual shows it as a row of its own.
The check covers every rater that declares RSL 0.4.1 or later.
Example
premium adds the expense fee to an inline max.
max to its own calculation and read that calculation by name. A label and a note on it give the new row its words in the manual.
Complete files
Complete files
bad/rater.rsl
good/rater.rsl
E-ROLE-FLOW
The premium build reads each role its way. In therating@2 vocabulary every concept has a role: premium, factor, base, fact, constraint or choice. Premiums, factors and bases form the premium build. The check follows how the premium build reads the other roles.
A choice is a value the underwriter enters, such as a position in a filed range. The premium build takes it as the position of select(low..high, position) or after overridden by. The filed range then stays in view beside the choice.
A constraint, such as a minimum premium or a rate cap, bounds a value through max, min or select. A flag decides a condition.
Example
premium multiplies by schedule_position, the underwriter’s Selection, as if it were a factor.
select over the filed range.
- The premium build multiplies or adds a constraint, such as a
RateCaporValidationvalue. Apply it withmax(…)ormin(…), or state its test as an admission rule. - The premium build uses a flag, such as an
Eligibilityvalue, as a number. Test the flag in anif.
Complete files
Complete files
bad/rater.rsl
good/rater.rsl
E-ROLE-CONCEPT
A concept’s role matches its use. In therating@2 vocabulary a premium, a factor and a base are operands of the premium build. The check compares that claim with what the rater does. It finds a value with one of those concepts that only bounds another value, only serves admission rules or only chooses.
Such a value is a constraint or a choice. Under the right concept, the rating manual shows it beneath the value it serves and keeps it out of the premium chain.
Example
lowest_factor is the low end of a select range and takes the factor concept Relativity.
Bound. The plain type Factor also passes, because the compiler infers the role from the reads.
- Admission rules are the only readers of the value. The help line gives a constraint concept.
- The value serves only as the position of a
select(…). It is a choice: use the concept the help line names.
Complete files
Complete files
bad/rater.rsl
good/rater.rsl
E-CONCEPT-PARENT
A concept has a role. In a vocabulary with roles, each concept says what its value does in the rating: premium, factor, base, fact, constraint or choice. A child concept inherits the role of its parent. This check guards a value whose concept lacks a role along its whole line of parents. A current rater stays clear of it. A rater reads the built-in vocabulariesrating@1 and rating@2 only, and every concept of rating@2 has a role. A concept name from outside the vocabulary gets E-CONCEPT-UNKNOWN.
E-VOCABULARY
The spec names a vocabulary rslc knows. A vocabulary is the list of concepts a rater may use, such asRelativity and PolicyPremium. The compiler has two built in: rating@1 and rating@2. The optional vocabulary field of spec picks one, and the check asks it to be one of the two.
A rater that declares RSL 0.4.1 reads rating@2 when spec leaves the field out. rating@2 adds a role to every concept and checks how the premium build reads each role.
Example
spec asks for rating@3.
rating@2, or remove the field to read the same vocabulary.
specnamesrating@2and declares an RSL version before 0.4.1. Declarersl: "0.4.1", or removevocabularyto readrating@1.
Complete files
Complete files
bad/rater.rsl
good/rater.rsl