Skip to content

Instantly share code, notes, and snippets.

@arthurp
Last active January 3, 2023 19:57
Show Gist options
  • Save arthurp/80452f0dd3df030ce50332a652c91f8e to your computer and use it in GitHub Desktop.
Save arthurp/80452f0dd3df030ce50332a652c91f8e to your computer and use it in GitHub Desktop.
Semantics versions defined using infinite ordinals
You can define an ordering that would usually be lexical (order (x, y, z) by ordering x first,
then y within that, then z within that) or even nested lexical by instead adding together various
expressions which use ordinal numbers (represented as the naturals) and the constant Ω which is
the first uncountable ordinal meaning that Ω is greater than all countable ordinals (i.e., all
ordinals 0, 1, 2, .....). So Ωz (for all z) is strictly larger than any finite x, meaning that
the lexical ordering of (x, y) is the same as the ordering of the infinite ordinal Ω*x + y.
This expands to any number of elements in tuple and allows for nested tuples.
Versions x.y.z are represented as (x, y, z) and ordered as above. The definition of semantic
versioning is then: Symantic versions which differ only by a countable amount are bug
compatible and all versions that different by an amount Ωx where x is countable are API
compatible. I think that's actually most of the definition, in by far the least useful way
ever expressed.
Note: As much as LISP and ACL2 are in my opinion some of the worst designed languages ever created
(did you know that LISP was never designed to be used by humans? I'm not even joking here.), I
think the ACL2 description of this is actually very nicely applied and practical:
https://www.cs.utexas.edu/users/moore/acl2/manuals/current/manual/index-seo.php/ACL2____O-P
@arthurp
Copy link
Author

arthurp commented Jan 3, 2023

I think there is a mistake in how the approach generalizes to larger tuples and nested tuples. It's not worth fixing though since this is all a joke.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment