> ## Documentation Index
> Fetch the complete documentation index at: https://docs.canary.effectiveai.app/llms.txt
> Use this file to discover all available pages before exploring further.

# About RSL

> RSL (Risk Specification Language) is Effective’s language for insurance rating algorithms and underwriting rules.

An RSL file states a rating plan the way its filing does: inputs, rate tables, rules, calculations and rounding, each tied to its source.
The `rslc` compiler checks the file and packages it for Relativities to run locally.

## What RSL is

RSL describes three things:

| Part | What it holds |
| - | - |
| A rater (`rater.rsl`) | The rating algorithm: typed inputs, rate tables, rules, calculations, and returned premiums |
| A guideline (`guideline.rsl`) | The underwriting rules over a rater: roles, the role that answers each question, referrals |
| A submission log | The answers, sign-offs, quotes, and bind of one submission, in the order they happen |

A rater stands alone, and most work starts there. A guideline uses a rater, and a submission log records each answer and act on one submission.
[Raters and guidelines](https://docs.canary.effectiveai.app/rsl/explanation/raters-and-guidelines.md) explains how the parts fit.

## What you do with RSL

1. Write the rating algorithm as a rater, with a citation for each filed number.
2. Check it with `rslc check`, and fix each message.
3. Test its premiums against independent rating examples.
4. Package it as a bundle, then rate one policy or a whole book with Relativities.
5. Add the questions an application asks, and the underwriting rules of a guideline.

Steps 1 to 4 make a working rater. Step 5 is for a program that collects answers from people.

## What the compiler guarantees

A rater that passes `rslc check` gives a value for every request it accepts: each lookup finds a row, and each division has a nonzero divisor.
Arithmetic is exact, and a value changes only at a `round` that the rater writes.
Each table, constant, and rounding cites its source.
The check describes the implementation, so a reviewer and independent examples still establish that the rater follows the filing.
[Language guarantees](https://docs.canary.effectiveai.app/rsl/guarantees.md) states these properties in full, with a program that breaks each one.
[Checks and guarantees](https://docs.canary.effectiveai.app/rsl/explanation/checks-and-guarantees.md) lists each checked property and what still needs review.

## Choose a starting point

| Goal | Start here |
| - | - |
| Try RSL in five minutes | [Quickstart](https://docs.canary.effectiveai.app/rsl/quickstart.md) |
| Know what the language guarantees | [Language guarantees](https://docs.canary.effectiveai.app/rsl/guarantees.md) and [The type system](https://docs.canary.effectiveai.app/rsl/explanation/type-system.md) |
| Build a rater from a rating manual | [Write your first rater](https://docs.canary.effectiveai.app/rsl/tutorial/first-rater.md) |
| Add the questions an application asks | [The questions tutorial](https://docs.canary.effectiveai.app/rsl/tutorial/ask-questions.md) |
| Add underwriting rules and referrals | [The guideline tutorial](https://docs.canary.effectiveai.app/rsl/tutorial/first-guideline.md) |
| Read or review RSL | [RSL at a glance](https://docs.canary.effectiveai.app/rsl/language-tour.md) |
| Get one task done | A how-to guide, such as [Use a filed rate table](https://docs.canary.effectiveai.app/rsl/how-to/read-a-filed-table.md) or [Test a rater](https://docs.canary.effectiveai.app/rsl/how-to/test-a-rater.md) |
| Look up a form, a type, or a function | [The language reference](https://docs.canary.effectiveai.app/rsl/reference/language.md), [Sections, types and annotations](https://docs.canary.effectiveai.app/rsl/reference/names.md), and [Functions](https://docs.canary.effectiveai.app/rsl/reference/functions.md) |
| Understand a check message | [Check messages](https://docs.canary.effectiveai.app/rsl/reference/check-messages.md) |
| Run the compiler | [Use the rslc commands](https://docs.canary.effectiveai.app/rsl/commands.md) and [the command reference](https://docs.canary.effectiveai.app/rsl/reference/commands.md) |

To use existing rating programs, start with [Rate a book with a program](https://docs.canary.effectiveai.app/relativities/how-to/rate-a-book-with-a-program.md).

## Read the docs in your terminal

The reference ships with the compiler, so it matches the installed version and works offline:

```sh theme={"languages":{"custom":["languages/rsl.tmLanguage.json"]}}
rslc docs
```

```text theme={"languages":{"custom":["languages/rsl.tmLanguage.json"]}}
RSL 0.4.1 reference. Run `rslc docs TOPIC`:

  sections     the sections of a file, in order
  types        the types and type forms
  functions    the functions; `rslc docs round` explains one
  annotations  the annotation keys, such as `cite` and `ask`
  messages     the check messages; `rslc explain E-CODE` explains one

`rslc examples` lists the example raters.
```

`rslc explain` takes the code of a check message. It prints what the check asks for, a rater that gets the message, and the fix:

```sh theme={"languages":{"custom":["languages/rsl.tmLanguage.json"]}}
rslc explain E-PROVENANCE
```

```text theme={"languages":{"custom":["languages/rsl.tmLanguage.json"]}}
# E-PROVENANCE: A filed number needs a citation

Each table, constant and rounding states a number from the filing. The check asks each one to cite the region of the source document that prints it.
...
```

`rslc examples` lists the example raters on [the examples page](https://docs.canary.effectiveai.app/rsl/reference/examples.md), and `rslc examples get dwelling` saves one to a folder.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.