这是一份nottingham诺丁汉大学COMP1009作业代写的成功案例
procedure PassResult(terminate: integer;
inp1, inp2, out2: channel; var done boolean);
var $y$ :ResultTypes;
count:integer;
passing : boolean;
begin
done: =false;
passing : =true;
count: =0 ;
while not done and (count<terminate) do
pol1
inpl?result(y) $\rightarrow$
if passing then begin
out2 ! result (y) ;
passing: = false
end $\mid$
inp2?result $(y) \rightarrow$
if passing then begin
out2 ! result ( $y)$;
passing: false
and $\mid$
inpl?complete $\rightarrow$
count: $=$ coun $t+1$;
if count=terminate then out 2 ! complete |
inp2?complete $\rightarrow$
count: =count $+1$;
If count werminate then out 2 ! complete |
inpl ?eos $\rightarrow$ done: = true
end ;
COMP1009 COURSE NOTES :
If $r$ and $s$ are odd primes, then prime $p$ satisfies
$$
p \equiv 1(\bmod r) \equiv s-1(\bmod s)
$$
if $p$ is of the form
$$
p=u(r, s)+k r s
$$
where
$$
u(r, s)=\left(s^{r-1}-r^{x-1}\right) \bmod r s
$$
and $k$ is an integer.