enrich ref with sorts
id;
variables
id : id;
O : ref → id; end enrich