// We'll only use tST - tST itself will use other tables \l tST.k balance: 0; // amount of money inserted selection: 0; // selection - 0 is no selection dispensed: 0; // 1 if machine has dispensed successfully cancelBtn: 0; // 1 if user pressed cancel button // 1. money inserted balance+: 3; // tST -> start selecting, na: next action na: tST[(balance;selection;dispensed;cancelBtn);0N]; // 0N no args // This will update the state na[]; // 2. select item selection: 1; na: tST[(balance;selection;dispensed;cancelBtn);0N]; na[]; // Here the machine must have dispensed, the stocks SS updated and machine is back to Idle again