rslc compiler.
E-ORPHAN-COMPUTED
Every calculation feeds a rating outcome. A rater declares what it returns inRatingOutcomes. The check follows each outcome back through the calculations it reads, and through the calculations those read. A calculation outside that chain is an error.
Such a calculation is one of two things. It is left over from an earlier draft, or it is a filed step that the premium forgot to apply. The second kind changes the premium, so the check asks you to decide which one you have.
A calculation that a rule on the record reads is also in use. In a rater with such a rule, the message names a declared rating outcome or calculated admission guard.
Example
The step computes payroll_in_thousands, and premium repeats the division in place of reading it.
premium reads self.payroll_in_thousands. When the calculation is left over from a draft, delete it.
Complete files
Complete files
bad/rater.rsl
good/rater.rsl
E-UNREAD-INPUT
Every input rates or decides eligibility. The caller supplies every input the rater declares. The check asks that each one does some work. An outcome reads it through the calculations, or a business rule reads it to accept or refuse the risk. An unread input is a question the caller answers for zero effect. More often it marks a filed step that the premium forgot, and the rater then returns the wrong number for every risk. A plain range on the field, such aswhere self in [0.5, 2], describes the input and leaves it unread. A rule that carries a code and a message decides eligibility, so it counts as a reader.
Example
The policy asks for experience_mod, and the premium leaves it out.
self.experience_mod. Delete an input that the filing leaves unused.
Complete files
Complete files
bad/rater.rsl
good/rater.rsl
E-TABLE-UNUSED-DIM
Each table dimension changes an output. A table’sdims are the keys a lookup supplies. The check reads the table’s rows and asks that each dimension matters. Somewhere in the file, moving along that dimension changes an output.
A dimension that leaves every output the same is outside the filed function. It multiplies the rows, it adds an argument to every lookup, and it suggests the rate depends on a fact that the filing ignores.
Carriers often print an exhibit this way, with one column repeated for every band. The rater keeps the numbers and the citation and drops the repeated key.
Example
BaseRate is keyed on territory and payroll band, and each territory has one rate across all three bands.
dims, keep one row for each remaining key, and drop the argument from each lookup. Here the PayrollBand type goes too, since the table was its only reader.
Complete files
Complete files
bad/rater.rsl
bad/tables/BaseRate.csv
good/rater.rsl
good/tables/BaseRate.csv
E-IF-AS-TABLE
A long band chain belongs in a table. Anif chain that sorts one number into bands and returns a fixed value for each band is a filed table written as code. The check reports such a chain once it reaches eight arms, counting the final else.
A chain qualifies when every condition compares the same number with literal cut points and every arm is a literal. Shorter chains, and chains whose arms compute something, stay as they are.
A table states each cut once and carries a citation to the exhibit that prints it. The compiler then proves that the table answers every admitted value.
Example
size_factor sorts payroll into eight bands with seven comparisons and a final else.
DecimalBands when the cuts are decimal numbers.
tables/SizeFactor.csv
Complete files
Complete files
bad/rater.rsl
good/rater.rsl
good/tables/SizeFactor.csv
E-TABLE-DUPLICATE
Each filed column lives in one table. The check compares the output columns of tables that share the same dimensions. When a column of one table equals a column of an earlier table on every row, the later table gets this message. One filed number has one home. Two copies start equal and drift apart when a later filing updates one of them. A single table keeps every lookup on the same numbers. The check also applies when each table cites its own exhibit. The table you keep carries both citations, so a reviewer still finds both pages. ExampleProfessionalTerritory repeats the three territory factors of GeneralTerritory.
tables/ProfessionalTerritory.csv
general and a professional output passes the check.
Complete files
Complete files
bad/rater.rsl
bad/tables/GeneralTerritory.csv
bad/tables/ProfessionalTerritory.csv
good/rater.rsl
good/tables/GeneralTerritory.csv
E-TABLE-SINGLE-MEMBER-KEY
A table key has two or more values. A table dimension chooses among rows. The check reports a dimension whose type is an enum with one member, because every lookup then supplies the same value. Filed exhibits often print such a column, for example a “Program” column that reads “Standard” on every row. Copying it into the rater adds a key that selects among one choice. Each lookup carries an extra argument, and the table looks as if the rate depends on it. An enum that loads its members from a CSV file is exempt, since its member list lives outside the rater. ExampleBaseRate is keyed on program, and Program has the single member standard.
dims, delete its CSV column, and drop the argument from each lookup. The Program type goes too once the table stops reading it.
Complete files
Complete files
bad/rater.rsl
bad/tables/BaseRate.csv
good/rater.rsl
good/tables/BaseRate.csv
E-HOIST
A calculation belongs where its value varies. A record in a list computes its calculations once for each element. The check reports a calculation on a child record that reads only constants and the data of an ancestor record. Every element then computes the same value. The value belongs to that ancestor. Declared there, it is computed once, and the rater shows which record the number depends on. That matters to a reviewer: a rate that varies by policy sits on the policy, and a rate that varies by location sits on the location. A calculation that reads any input of its own record stays where it is. Example EachLocation computes modified_rate from a constant and the policy’s experience_mod.
self. where it read Policy.. The child reads it as Policy.modified_rate.
Complete files
Complete files
bad/rater.rsl
good/rater.rsl
E-TABLE-UNUSED
A lookup reads every table and column. Every table a rater declares is checked against its CSV file, cited and shipped with the rater. The check asks that alookup! reads each table, and each output column of it.
A table that the calculations leave unread is one of two things. It is data from an earlier draft, or it is a filed factor that the premium forgot to apply. The second kind gives a wrong premium for every risk, so the check asks you to decide.
Example
The rater declares the SizeFactor table, and the premium leaves the size factor out.
size_factor reads the table and the premium multiplies by it.
When the filing leaves the table unused, delete it from Tables and delete its CSV file.
- A lookup reads the table and skips one of its outputs:
no lookup reads output … of table …. Read the output, or delete it from the table and from the CSV file. - A geography in
Geographieshas a declaration and zerolocatecalls:geography … is never located. Locate a point in it, or delete it.
Complete files
Complete files
bad/rater.rsl
bad/tables/SizeFactor.csv
good/rater.rsl
good/tables/SizeFactor.csv
E-TABLE-CONSTANT-COLUMN
A column with one value is a constant. A table holds numbers that vary with its keys. The check reads each output column and reports one that holds the same value on every row. Such a column is a single filed number written once for each row. A constant states it once with its own citation. A reader then sees that the value is the same for every risk. Filed exhibits often print a column this way, so a faithful copy of the exhibit gets the message too. The constant keeps the exhibit’s citation. ExampleTerritoryRate carries a minimum_premium column, and every territory has the same $500 minimum.
Constants with the table’s citation, delete the column from the table and its CSV file, and read the constant.
A factor of 1 or an addend of 0 needs less: delete it from the calculation. Delete a table whose every output is constant.
- One member of a keyed output, such as
rate[wind], holds one value on every row. The help then shows how to keep the varying members in the table.
Complete files
Complete files
bad/rater.rsl
bad/tables/TerritoryRate.csv
good/rater.rsl
good/tables/TerritoryRate.csv
E-TABLE-FORMULA
A straight-line table is a formula. Some filed exhibits print the results of a formula, one row for each key. The check reads each numeric dimension of a table and tests whether an output equalsa * key + b on every row. It reports the column once 32 or more single key values fit the line.
A formula states the rule once. A table of its values hides the rule, adds a row for each key, and stops at the last key the exhibit prints.
Shorter schedules stay tables: a filing that lists four driver counts is stating four numbers. A column with a single row off the line also stays.
Example
WorkerCharge lists a charge for 1 to 32 workers, and every charge is $12.50 times the worker count.
tables/WorkerCharge.csv
min(workers, 33).
Complete files
Complete files
bad/rater.rsl
bad/tables/WorkerCharge.csv
good/rater.rsl