addResult(ident uid, ident id, ident studentId, ident taskId, double points) { assume exists /account[uid]/examiner[id]; assume exists /exam[id]/participant[studentId]; # can also be implicitly true in an OO language assume exists /exam[id]/task[taskId]; assume not exists /exam[id]/participant[studentId]/result[taskId]; assume points >= 0 && points <= /exam[id]/task[taskId]/maxPoints; insert /exam[id]/participant[studentId] <result task=[taskId] points=[points] />; }