spec block. It names the RSL version, the carrier, the state, the product, and the effective date:
rslc reads RSL 0.4 and 0.4.1. A file that declares another version gets one E-RSL-VERSION message. Versions explains the two.
File structure
A rater is a sequence of sections. Most raters use these, in this order:
The order is a convention: the compiler reads the sections in any order. Lines beginning with
# are comments.
Other sections serve other files, such as import for a split rater and use, Roles and Acts for a guideline. Sections, types and annotations lists every section.
Files and versions in the language reference states the rules of a file.
Types and inputs
TheTypes block defines names used throughout the rater:
Perillists named choices.ProtectionClassdefines bands starting at 1, 4, 7, and 10.Moneyrepresents amounts in whole cents.
inputs block declares the facts supplied to a record:
Common input types
Common input types
An optional input’s meaning comes from the rating algorithm. It can represent an absent coverage or a value handled by an explicit default.Sections, types and annotations lists every type.
Input rules
Awhere clause restricts an input:
self refers to the input value. [1, 10] includes both endpoints.
The rule carries a code, message, and source citation. A request that breaks this rule receives a refusal with those details.
Example conditions
Example conditions
Numeric inputs require a declared precision and range. A set such as
{6, 12} further restricts that range.Follow-up inputs
A follow-up input is a fact the rater needs only for some risks. The follow-up, question and label excerpts quote this second small rater.vacancy/rater.rsl
vacancy/rater.rsl
vacancy/rater.rsl
when states the condition that makes the input part of a request:
vacant_months. A request for an occupied dwelling leaves it out.
A calculation reads a follow-up input where its condition holds:
if self.vacant then, the compiler knows the answer is present.
Ask questions builds a rater with follow-up inputs, and Follow-up inputs in the language reference states the rules.
Questions
Anask annotation gives an input the question a person answers:
Constants and calculations
A constant gives a fixed value a name:step block holds calculations. Each calculation declares its name, type, and formula:
self.value reads an input from the same record.
RSL keeps arithmetic exact between explicit rounding steps.
A calculation is arithmetic over named values, constants, and inputs. The arithmetic can nest, so one step of the filed rating algorithm is one calculation:
if, match, round, or pow inside arithmetic gets its own name. The tutorial names its rate lookup base_rate, and peril_premium multiplies by self.base_rate[p]. A label is optional on a working value.
Read and combine calculated values
Read and combine calculated values
The compiler determines calculation order from dependencies.
Rule clauses
Rule clauses
A calculation can end with rule clauses, in this order. A rater that uses them declares
rsl: "0.4.1".An exception applies before the formula.
with … otherwise decides only whether the formula applies.select(low..high, position) gives a value between a filed low and a filed high. It also needs rsl: "0.4.1".Preferred forms
Preferred forms
Rating tables
TheTables block declares a table’s keys and returned values:
tables/BaseRate.csv. The column mapping connects each peril’s rate to its CSV column.
Read a rate with lookup!:
p.
Use a filed rate table covers table keys, CSV layouts, and fallback values.
Tables and lookups in the language reference states the rules of a table and of lookup!.
Rounding
Each rounding operation states its decimal places and rounding mode:2 means two decimal places. half_up rounds halfway values up.
Round a premium describes the available rounding modes, and Rounding in the language reference states the rules.
Sources and citations
TheSources block identifies supporting documents:
artifact(...) refers to a document in Effective by its artifact ID. This example uses a placeholder for a synthetic manual.
A citation connects a rule or value to a source location:
manual:p9 means page 9 of the document named manual.
Citations explains source locations and citation requirements.
Sources and citations in the language reference lists the region form of each source kind.
Labels and concepts
Labels, notes, concepts, and stages describe a rater on its rating manual page. They are optional, and the rate stays the same when a rater adds them. Thevacancy rater above declares two stages and labels each filed value:
- A
labelmarks a value that the filing names, such as a rating step, a filed factor, a premium, a discount, or a fee. Itsnoteis one sentence. - An unlabelled value is a working value, such as a lookup, a range end, a key, or a partial sum. It takes its role and its citation from the value that it serves. The rating manual shows it inside the value that reads it.
- A concept, such as
BasePremium(Premium), states what a labelled value is. A concept on a table column, such asBaseRate(Rate[Peril]), applies to each lookup of that column. Stagesnames the parts of the filed algorithm, andstep base in baseputs a step in one part. A step takes its note from its stage or states its own.
rating@2 vocabulary. Each concept has a role, such as these:
- A
Creditis a discount ratio, such as 0.05, that applies as1 - credit. A filed multiplier, such as 0.80, is aRelativity. - A fact that the request supplies is a
Classificationor another fact. - For a value that lacks a concept, the compiler infers the role from the values that read it.
Rating outcomes
RatingOutcomes selects the values returned by the rater:
premium.
Outcomes in the language reference lists the types an outcome may have.
Guidelines
A guideline is a second RSL file that holds underwriting rules. It uses a rater and adds roles, question owners and referrals. These excerpts quote thestaffing example on the examples page.
use links the rater under a name, and Roles orders the people who answer and sign off:
by, and a calculation reads the rater’s premium:
refer clause sends a submission to a role for sign-off:
where rule on the record still refuses a submission outright.
Write your first guideline builds this example, and Raters and guidelines explains the split.
Guidelines in the language reference states each form.
Next steps
- Write your first rater to run the complete example.
- Read Checks and guarantees to understand what the compiler verifies.
- Use the rslc commands to check and package a rater.
- Look up a form in the language reference.