Did you know ... Search Documentation:
Packs (add-ons) for SWI-Prolog

Package "uk_plate_age"

Title:Registration periods from UK (GB) number plate age identifiers
Rating:Not rated. Create the first rating!
Latest version:1.0.0
SHA1 sum:baa6f662dedaca17c05d66ed15edf9097bbddf9a
Author:CarCheckHQ team <support@carcheckhq.com>
Maintainer:CarCheckHQ team <support@carcheckhq.com>
Packager:CarCheckHQ team <support@carcheckhq.com>
Home page:https://carcheckhq.com/tools/number-plate-decoder
Download URL:https://framagit.org/carcheckhq/uk-plate-age/-/raw/main/prolog/uk_plate_age-*.tgz

Reviews

No reviews. Create the first review!.

Details by download location

VersionSHA1#DownloadsURL
1.0.0baa6f662dedaca17c05d66ed15edf9097bbddf9a1https://framagit.org/carcheckhq/uk-plate-age/-/raw/main/prolog/uk_plate_age-1.0.0.tgz

uk_plate_age (SWI-Prolog pack)

Works out when a vehicle was first registered from the age identifier on a Great Britain number plate. Same rules as our Python, D, Haxe and Racket ports, following DVLA leaflet INF104.

?- pack_install(uk_plate_age).
?- use_module(library(uk_plate_age)).

?- plate_period("AB24 CDE", Start, End).
Start = 2024-3, End = 2024-8.

?- plate_period_text("ab74cde", T).
T = "September 2024 to February 2025".

?- plate_period("P123 ABC", S, E).
S = 1996-8, E = 1997-7.

?- identifiers_for_year(2025, Ids).
Ids = [25, 75].

How the identifiers work

  • Current format (September 2001 onwards): from 1 March the two digits are the year (24 = March to August 2024). From 1 September they are the year plus 50 (74 = September 2024 to February 2025). 51 came first; 00, 01 and 50 were never issued.
  • Prefix format (August 1983 to August 2001): one letter at the start. It changed every August until 1998, then every March and September. I, O, U and Z were not used, and Q is for vehicles of unknown age.

What a plate cannot tell you

A private plate can make a car look older than it is, never newer. Dateless and Northern Ireland plates have no age identifier, and imports are dated from their first UK registration. The exact answer is the date of first registration on the V5C. plate_period/3 fails when there is no identifier.

Tests

swipl -g run_tests -t halt test/test_uk_plate_age.pl

Licence

MIT. Maintained by the CarCheckHQ team (DESKLINK LTD). The same decoder runs in the browser at https://carcheckhq.com/tools/number-plate-decoder

Contents of pack "uk_plate_age"

Pack contains 5 files holding a total of 9.0K bytes.