# Semigroup from posets

Let $P$ be a finite poset (we can assume it is connected). Then on the set of intervals $Int(P)$ there is a semigroup structure given by the multiplication: $[a,b][c,d]=[a,d] if b=c$ and $[a,b][c,d]=0$, else.

Question: Is there an easy way to obtain for a given poset $P$, this semigroup in Sage?

At very least it can be done like in this answer https://ask.sagemath.org/question/320...