Last active
January 3, 2023 19:57
-
-
Save arthurp/80452f0dd3df030ce50332a652c91f8e to your computer and use it in GitHub Desktop.
Semantics versions defined using infinite ordinals
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.