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

# About RSL

> RSL is the language for writing an insurance rater, the steps that turn the facts about a policy into its filed premium.

RSL expresses a rating algorithm as typed inputs, constraints, tables, calculations, rounding rules, and source citations.
`rslc` checks that implementation and packages it as a versioned rater bundle. Relativities runs the bundle locally.

For comparative rating, the same bundle supports repeated pricing, sensitivity analysis, and inspection of the calculations behind a premium.
Start with [Compare carriers](/relativities/how-to/compare-carriers) to use existing programs, or follow this section to build and review a rater.

```mermaid theme={null}
flowchart LR
  write["1. Write the rater in RSL"] --> check["2. rslc check"]
  check --> export["3. rslc export: a bundle"]
  export --> rate["4. Rate requests"]
  rate --> premium["Premium"]
  rate --> refusal["Refusal with reasons"]
```

## A small rater

This rater prices a dwelling fire policy from its Coverage A amount and its protection class. It
is the running example in this guide:

```rsl theme={null}
Records = {
    Policy = {
        inputs {
            dwelling: Dwelling,
            items: List(Item)
                where len(self) in [0, 10] [code: "TOO-MANY-ITEMS", message: "A policy schedules at most ten items.", cite: manual:p6]
        },
        step premium {
            peril_premium[p: Peril]: Premium [cite: manual:p8] =
                round(self.dwelling.coverage_a / 1000 * lookup!(BaseRate, self.dwelling.protection_class).rate[p], 2, half_up),
            item_charge: Premium [cite: manual:p6] = sum(self.items as i, i.charge),
            premium: Premium [cite: manual:p9] =
                round(sum(Peril as p, self.peril_premium[p]) + self.item_charge + expense_fee, 0, half_up)
        }
    },
```

Each line reads like the manual: a base rate per peril from a table, a charge per scheduled item,
a policy fee, and a rounding rule. Each number cites the manual page that prints it.

## Why write a rater in RSL

* **Calculation checks.** `rslc check` verifies accepted-input domains, table coverage, precision, and calculation dependencies before you package the rater.
* **Explicit refusals.** Input constraints carry codes and messages, with citations for filed rules. Refusals report detected violations within documented size limits.
* **Exact arithmetic.** Values stay exact through the declared calculations. Each rounding step states its precision and mode.
* **Source traceability.** Tables, constants, and rounding calculations carry citations or explicit reasons for values outside the filing.

Compiler checks establish properties of the implemented algorithm. Review source interpretations and reconcile independent rating examples to establish fidelity to the filing.
[Validate a program](/relativities/how-to/validate-a-program) covers this evidence alongside input mapping and comparison scope.

[What rslc checks and guarantees](/relativities/rsl/explanation/checks-and-guarantees) lists each promise and
the check behind it.

## Where to go

| You are | Start with |
| - | - |
| New to RSL and want to see a rater work | [Write your first rater](/relativities/rsl/tutorial/first-rater) |
| An actuary writing or reviewing a rater | [RSL at a glance](/relativities/rsl/language-tour), then the how-to pages |
| An engineer running a rater from code | [Use the rslc commands](/relativities/rsl/commands) |
| Deciding whether to trust a rater's results | [What rslc checks and guarantees](/relativities/rsl/explanation/checks-and-guarantees) |
| Looking up a check message or a refusal code | [Check messages](/relativities/rsl/reference/check-messages) and [Refusals](/relativities/rsl/reference/refusals) |


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