Rule uk_stamp_duty v1
The SDLT rate band a residential purchase falls in, and the surcharge on a second home. Transcribed from GOV.UK
Try a case
Enter the inputs: the rows that match light up and the outputs appear. What runs is the generated code itself, and the line it would write to a log is shown as it is.
Inputs
| Name | Type | Range | Notes |
|---|---|---|---|
| price | money[GBP] | 0GBP to 20_000_000GBP | |
| first_time | bool | ||
| additional | bool |
Outputs
| Name | Type | Rounding | Notes |
|---|---|---|---|
| band | rate | down(1%) (rounded down to 1%) | |
| surcharge | rate | down(1%) (rounded down to 1%) |
Table standard (policy unique)
| Column | Source |
|---|---|
| price | Input |
| → band | Output of this rule |
| # | price | → band (rate / down(1%)) | Notes |
|---|---|---|---|
| 1 | <=125000GBP (125000GBP or less) | 0% | |
| 2 | >125000GBP <=250000GBP (more than 125000GBP and 250000GBP or less) | 2% | Source: gov table1 |
| 3 | >250000GBP <=925000GBP (more than 250000GBP and 925000GBP or less) | 5% | Source: gov table1 |
| 4 | >925000GBP <=1500000GBP (more than 925000GBP and 1500000GBP or less) | 10% | Source: gov table1 |
| 5 | >1500000GBP (more than 1500000GBP) | 12% | Source: gov table1 |
What rulec check verified is under "How band is decided".
Table first_time_relief (policy unique)
Source: gov table2 (sources/uk-sdlt.md, sha256:799106ea8a821a00)
Property price band SDLT rate Up to £300,000 0% £300,001 to £500,000 5%
| Column | Source |
|---|---|
| first_time | Input |
| additional | Input |
| price | Input |
| → band | Output of this rule |
| # | first_time | additional | price | → band (rate / down(1%)) |
|---|---|---|---|---|
| 1 | true (yes) | false (no) | <=300000GBP (300000GBP or less) | 0% |
| 2 | true (yes) | false (no) | >300000GBP <=500000GBP (more than 300000GBP and 500000GBP or less) | 5% |
What rulec check verified is under "How band is decided".
Table second_home (policy unique)
Source: gov (sources/uk-sdlt.md, sha256:799106ea8a821a00)
| Column | Source |
|---|---|
| additional | Input |
| → surcharge | Output of this rule |
| # | additional | → surcharge (rate / down(1%)) |
|---|---|---|
| 1 | true (yes) | 5% |
| 2 | false (no) | 0% |
What rulec check verified
- Every combination of inputs matches some row (E101 completeness)
- There is no row that can never match (E102 unreachable row)
- No input matches two or more rows at once (E105 overlap). Reordering the rows does not change the meaning
How band is decided
band is defined by table standard, table first_time_relief; they are tried in the order table first_time_relief, table standard, and the first that applies is the answer.
- table first_time_relief takes precedence over table standard. in some of the 4 pairs that meet, the rows of table first_time_relief reach beyond the other's (precedence)
What rulec check verified
- Every combination of inputs matches some row of table standard, table first_time_relief (E101 completeness)
- There is no row that can never match (E102 unreachable row)
- No overlap is left without a precedence (E105). An input that matches two definitions is decided by the precedence above
Examples (verified)
| price | first_time | additional | → band | surcharge |
|---|---|---|---|---|
| 100000GBP | false | false | 0% | 0% |
| 200000GBP | false | false | 2% | 0% |
| 200000GBP | true | false | 0% | 0% |
| 400000GBP | true | false | 5% | 0% |
| 600000GBP | true | false | 5% | 0% |
| 200000GBP | false | true | 2% | 5% |
| 2000000GBP | false | false | 12% | 0% |
rulec check ran these 7 examples through the reference evaluator, and every one produced the declared values (E107). The examples are an executable specification.