A Graphical Introduction to Lattices
philosophyforprogrammers.blogspot.com
philosophyforprogrammers.blogspot.com
For example, CvRDTs (a class of conflict-free replicated data types), are made up of the semilattices over a monotonic operation. If you can prove a few basic properties about your data + the merge operation over it, you can construct a CRDT. It won't necessarily be efficient, but it's a good starting point for reasoning about the problem.
People spend a lot of time trying to sell abstract algebra using monads, but in my opinion it's a lot easier to grasp the applications of lattices.
Without lattices, we would never have had the ambiguous phrase "computer scientists commonly choose models which have bottoms, but prefer them topless" occurring in a serious textbook.
Edit: agreed, intellectual descent is only partially ordered, but the interval between aristotle's example syllogism and lattices contains a chain. Guess I should've said "also comparable (by."
Then, parameterizing the choice situation and / or introducing strategic dependecies between actors leads to analyzing sub/supermodular correspondences on these sets. In fact, the most general version would make use of quasi-supermodularity. I think Milgrom&Roberts 94 show that this is the most general way, one can think of coherent (rational) decision theory.
Preference relations of rational agents are, anyway. When it comes to us mere mortals, well, see https://en.wikipedia.org/wiki/Intransitivity#Occurrences_in_....
If it were so, then human behavior would be impossible to analyze. Instead, if we focus on causes and consequences of non transitive preferences - like in behavioral economics - we may regain the ability to do analyzes.
The semantics of determinate CCP programs (and by extension, LVars programs) can be described really beautifully in terms of closure operators on the underlying domain. I'm not sure this made it into the initial published thesis, but this is an accessible paper on the topic: http://www.lix.polytechnique.fr/comete/stages/references/ccp...
This book is quite famous in the field and all about lattices as you can infer from its cover: https://dl.acm.org/doi/book/10.5555/1965094
It's full of pseudocode and algorithms.
A monotonic operation is one that’s either non-decreasing or non-increasing. That is, it never reverses direction.
So in the context of conflict-free replicated data types, you can think of something like an append-only database as a basic example. Over time, the database can only grow or stay the same. It can never shrink. This allows you to split the database into pieces and distribute them. You always know they can be merged back together because they’re append-only. This makes it a join semilattice with the union of corresponding tables being the least upper bound operation.
The core idea is that every binary relation (think of a binary matrix representing for example "Animal a has Property p") leads to a lattice of `concepts` associated to this relation. This lattice turns out to be very nice (it is complete: every supremum and infimum exists, even infinite ones) and conversely, every complete lattices is such a concept lattice in a very natural way (the relation that leads back to the comlete lattice is then `a is smaller than b`).
This allows to translate phenomena between the world of lattices and the world of relations with many applications in for example data mining.
I haven't tried to understand the more advanced extensions listed on the Wikipedia page, they might be able to rectify this kind of problem.
https://link.springer.com/chapter/10.1007%2F978-3-642-29892-...
https://golem.ph.utexas.edu/category/2013/08/the_nucleus_of_...
Tai-Danae Bradley works with these ideas applied to probability distributions on a product space. The same formal ideas developed in this linear algebraic context lead to a very rich theory.
https://johncarlosbaez.wordpress.com/2020/05/07/formal-conce...
""" Every operation which preserves a lattice and doesn't use "incomparable" objects is equivalent to addition. """
And the statement at the end: "any lattice is equivalent to another lattice where the relationship is set inclusion." This only holds for distributive lattices.
For another take on lattice theory, and ordered structures more generally:
https://www.azimuthproject.org/azimuth/show/Applied+Category...
Domain theory[1] also makes heavy use of this.
[0] https://en.wikipedia.org/wiki/Knaster%E2%80%93Tarski_theorem
That means that for any pair of types, there is a least upper bound type that is a supertype of both of them. (When discussing this, we usually allow a type to be considered its own supertype. So by "X is a supertype of Y" we mean something more like "every instance of Y is also an X". So String is its own supertype because every String is also a String.) For example, the least upper bound of Object and List is Object. The least upper bound of ArrayList and Stack is List, etc.
This is important because there are places where you need to find a type that contains all values of two other types. For example, say you are type checking:
foo(condition ? a : b);
Is this a valid call? To determine that, you need to see if the type of the argument matches the declared parameter type on foo. But what is the type of a conditional operator? The value could have type a or type b. You need a type that subsumes both of those. The answer most languages use is to calculate the least upper bound of the types of the two branches. That works only because there is a least upper bound for every pair of types, and we know that because we know types form a semi-lattice.Are types a full lattice? For that, you also need a greatest lower bound, or a "meet". That means for any pair of types there needs to be a type that is a sub-type of both of them. In some languages that doesn't exist. But languages that have a "bottom" type give you this property. The bottom type, by definition, is a subtype of all types. So whenever you need the greatest lower bound, if there isn't any other obvious candidate (like if one of the types is directly a subtype of the other), you can just throw your hands up and use bottom.
There are still some core features and bugs being worked out but you can do exceptionally interesting things with it. https://gist.github.com/rudolph9/005f35c33e9255519d93c26058e...
Is anyone else getting a "[Math Processing Error]" in red at a bunch of places?
I'm seeing: >For example, [Math Processing Error], so multiplying by an integer "preserves" this lattice (on the Division section).
This one is even worse: >The relevant fact about logarithms is that [Math Processing Error], meaning that the problem of multiplying [Math Processing Error] and [Math Processing Error] can be reduced to the problem of adding their logarithms. (in the Everything is Addition section)
Maybe I'm just being pedantic - the numerical examples make more sense to me since any number can be its own factor.
I've never used Pijul, but I miss Darcs almost every day when interacting with Git.
Not super familiar with Pijul though!
But unlike in Darcs, where conflicts are messy and not super well-defined in all cases (and not to mention, sometimes cause Darcs to run for a time exponential in the size of the repo's history), two conflicting edits always commute in Pijul.
The main points of Pijul were (1) to solve the soundness issues with conflicts and (2) to fix the exponential problems.
I guess you could imagine your state to be the join of all its patches. That makes sense if you have an “add foo” patch and a “delete foo” patch and join them to get a “empty but remembering that foo was there once state” (which is required because joining “add foo” again must do nothing). But you also need to accept that “delete foo” on its own is a valid state (or any “resolve this merge conflict” patch) and it feels not great for that to be a valid state.
Generally I think you want slightly more constraints (than none) in which things may be merged or valid repo states.