]> git.lizzy.rs Git - plan9front.git/blob - sys/src/cmd/spin/run.c
show line numbers in dtracy type errors
[plan9front.git] / sys / src / cmd / spin / run.c
1 /***** spin: run.c *****/
2
3 /*
4  * This file is part of the public release of Spin. It is subject to the
5  * terms in the LICENSE file that is included in this source directory.
6  * Tool documentation is available at http://spinroot.com
7  */
8
9 #include <stdlib.h>
10 #include "spin.h"
11 #include "y.tab.h"
12
13 extern RunList  *X, *run;
14 extern Symbol   *Fname;
15 extern Element  *LastStep;
16 extern int      Rvous, lineno, Tval, interactive, MadeChoice, Priority_Sum;
17 extern int      TstOnly, verbose, s_trail, xspin, jumpsteps, depth;
18 extern int      analyze, nproc, nstop, no_print, like_java, old_priority_rules;
19 extern short    Have_claim;
20
21 static long     Seed = 1;
22 static int      E_Check = 0, Escape_Check = 0;
23
24 static int      eval_sync(Element *);
25 static int      pc_enabled(Lextok *n);
26 static int      get_priority(Lextok *n);
27 static void     set_priority(Lextok *n, Lextok *m);
28 extern void     sr_buf(int, int);
29
30 void
31 Srand(unsigned int s)
32 {       Seed = s;
33 }
34
35 long
36 Rand(void)
37 {       /* CACM 31(10), Oct 1988 */
38         Seed = 16807*(Seed%127773) - 2836*(Seed/127773);
39         if (Seed <= 0) Seed += 2147483647;
40         return Seed;
41 }
42
43 Element *
44 rev_escape(SeqList *e)
45 {       Element *r = (Element *) 0;
46
47         if (e)
48         {       if ((r = rev_escape(e->nxt)) == ZE) /* reversed order */
49                 {       r = eval_sub(e->this->frst);
50         }       }
51
52         return r;               
53 }
54
55 Element *
56 eval_sub(Element *e)
57 {       Element *f, *g;
58         SeqList *z;
59         int i, j, k, only_pos;
60
61         if (!e || !e->n)
62                 return ZE;
63 #ifdef DEBUG
64         printf("\n\teval_sub(%d %s: line %d) ",
65                 e->Seqno, e->esc?"+esc":"", e->n?e->n->ln:0);
66         comment(stdout, e->n, 0);
67         printf("\n");
68 #endif
69         if (e->n->ntyp == GOTO)
70         {       if (Rvous) return ZE;
71                 LastStep = e;
72                 f = get_lab(e->n, 1);
73                 f = huntele(f, e->status, -1); /* 5.2.3: was missing */
74                 cross_dsteps(e->n, f->n);
75 #ifdef DEBUG
76                 printf("GOTO leads to %d\n", f->seqno);
77 #endif
78                 return f;
79         }
80         if (e->n->ntyp == UNLESS)
81         {       /* escapes were distributed into sequence */
82                 return eval_sub(e->sub->this->frst);
83         } else if (e->sub)      /* true for IF, DO, and UNLESS */
84         {       Element *has_else = ZE;
85                 Element *bas_else = ZE;
86                 int nr_else = 0, nr_choices = 0;
87                 only_pos = -1;
88
89                 if (interactive
90                 && !MadeChoice && !E_Check
91                 && !Escape_Check
92                 && !(e->status&(D_ATOM))
93                 && depth >= jumpsteps)
94                 {       printf("Select stmnt (");
95                         whoruns(0); printf(")\n");
96                         if (nproc-nstop > 1)
97                         {       printf("\tchoice 0: other process\n");
98                                 nr_choices++;
99                                 only_pos = 0;
100                 }       }
101                 for (z = e->sub, j=0; z; z = z->nxt)
102                 {       j++;
103                         if (interactive
104                         && !MadeChoice && !E_Check
105                         && !Escape_Check
106                         && !(e->status&(D_ATOM))
107                         && depth >= jumpsteps
108                         && z->this->frst
109                         && (xspin || (verbose&32) || Enabled0(z->this->frst)))
110                         {       if (z->this->frst->n->ntyp == ELSE)
111                                 {       has_else = (Rvous)?ZE:z->this->frst->nxt;
112                                         nr_else = j;
113                                         continue;
114                                 }
115                                 printf("\tchoice %d: ", j);
116 #if 0
117                                 if (z->this->frst->n)
118                                         printf("line %d, ", z->this->frst->n->ln);
119 #endif
120                                 if (!Enabled0(z->this->frst))
121                                         printf("unexecutable, ");
122                                 else
123                                 {       nr_choices++;
124                                         only_pos = j;
125                                 }
126                                 comment(stdout, z->this->frst->n, 0);
127                                 printf("\n");
128                 }       }
129
130                 if (nr_choices == 0 && has_else)
131                 {       printf("\tchoice %d: (else)\n", nr_else);
132                         only_pos = nr_else;
133                 }
134
135                 if (nr_choices <= 1 && only_pos != -1 && !MadeChoice)
136                 {       MadeChoice = only_pos;
137                 }
138
139                 if (interactive && depth >= jumpsteps
140                 && !Escape_Check
141                 && !(e->status&(D_ATOM))
142                 && !E_Check)
143                 {       if (!MadeChoice)
144                         {       char buf[256];
145                                 if (xspin)
146                                         printf("Make Selection %d\n\n", j);
147                                 else
148                                         printf("Select [0-%d]: ", j);
149                                 fflush(stdout);
150                                 if (scanf("%64s", buf) <= 0)
151                                 {       printf("no input\n");
152                                         return ZE;
153                                 }
154                                 if (isdigit((int)buf[0]))
155                                         k = atoi(buf);
156                                 else
157                                 {       if (buf[0] == 'q')
158                                                 alldone(0);
159                                         k = -1;
160                                 }
161                         } else
162                         {       k = MadeChoice;
163                                 MadeChoice = 0;
164                         }
165                         if (k < 1 || k > j)
166                         {       if (k != 0) printf("\tchoice outside range\n");
167                                 return ZE;
168                         }
169                         k--;
170                 } else
171                 {       if (e->n && e->n->indstep >= 0)
172                                 k = 0;  /* select 1st executable guard */
173                         else
174                                 k = Rand()%j;   /* nondeterminism */
175                 }
176
177                 has_else = ZE;
178                 bas_else = ZE;
179                 for (i = 0, z = e->sub; i < j+k; i++)
180                 {       if (z->this->frst
181                         &&  z->this->frst->n->ntyp == ELSE)
182                         {       bas_else = z->this->frst;
183                                 has_else = (Rvous)?ZE:bas_else->nxt;
184                                 if (!interactive || depth < jumpsteps
185                                 || Escape_Check
186                                 || (e->status&(D_ATOM)))
187                                 {       z = (z->nxt)?z->nxt:e->sub;
188                                         continue;
189                                 }
190                         }
191                         if (z->this->frst
192                         &&  ((z->this->frst->n->ntyp == ATOMIC
193                           ||  z->this->frst->n->ntyp == D_STEP)
194                           &&  z->this->frst->n->sl->this->frst->n->ntyp == ELSE))
195                         {       bas_else = z->this->frst->n->sl->this->frst;
196                                 has_else = (Rvous)?ZE:bas_else->nxt;
197                                 if (!interactive || depth < jumpsteps
198                                 || Escape_Check
199                                 || (e->status&(D_ATOM)))
200                                 {       z = (z->nxt)?z->nxt:e->sub;
201                                         continue;
202                                 }
203                         }
204                         if (i >= k)
205                         {       if ((f = eval_sub(z->this->frst)) != ZE)
206                                         return f;
207                                 else if (interactive && depth >= jumpsteps
208                                 && !(e->status&(D_ATOM)))
209                                 {       if (!E_Check && !Escape_Check)
210                                                 printf("\tunexecutable\n");
211                                         return ZE;
212                         }       }
213                         z = (z->nxt)?z->nxt:e->sub;
214                 }
215                 LastStep = bas_else;
216                 return has_else;
217         } else
218         {       if (e->n->ntyp == ATOMIC
219                 ||  e->n->ntyp == D_STEP)
220                 {       f = e->n->sl->this->frst;
221                         g = e->n->sl->this->last;
222                         g->nxt = e->nxt;
223                         if (!(g = eval_sub(f))) /* atomic guard */
224                                 return ZE;
225                         return g;
226                 } else if (e->n->ntyp == NON_ATOMIC)
227                 {       f = e->n->sl->this->frst;
228                         g = e->n->sl->this->last;
229                         g->nxt = e->nxt;                /* close it */
230                         return eval_sub(f);
231                 } else if (e->n->ntyp == '.')
232                 {       if (!Rvous) return e->nxt;
233                         return eval_sub(e->nxt);
234                 } else
235                 {       SeqList *x;
236                         if (!(e->status & (D_ATOM))
237                         &&  e->esc && (verbose&32))
238                         {       printf("Stmnt [");
239                                 comment(stdout, e->n, 0);
240                                 printf("] has escape(s): ");
241                                 for (x = e->esc; x; x = x->nxt)
242                                 {       printf("[");
243                                         g = x->this->frst;
244                                         if (g->n->ntyp == ATOMIC
245                                         ||  g->n->ntyp == NON_ATOMIC)
246                                                 g = g->n->sl->this->frst;
247                                         comment(stdout, g->n, 0);
248                                         printf("] ");
249                                 }
250                                 printf("\n");
251                         }
252 #if 0
253                         if (!(e->status & D_ATOM))      /* escapes don't reach inside d_steps */
254                         /* 4.2.4: only the guard of a d_step can have an escape */
255 #endif
256 #if 1
257                         if (!s_trail)   /* trail determines selections, new 5.2.5 */
258 #endif
259                         {       Escape_Check++;
260                                 if (like_java)
261                                 {       if ((g = rev_escape(e->esc)) != ZE)
262                                         {       if (verbose&4)
263                                                 {       printf("\tEscape taken (-J) ");
264                                                         if (g->n && g->n->fn)
265                                                                 printf("%s:%d", g->n->fn->name, g->n->ln);
266                                                         printf("\n");
267                                                 }
268                                                 Escape_Check--;
269                                                 return g;
270                                         }
271                                 } else
272                                 {       for (x = e->esc; x; x = x->nxt)
273                                         {       if ((g = eval_sub(x->this->frst)) != ZE)
274                                                 {       if (verbose&4)
275                                                         {       printf("\tEscape taken ");
276                                                                 if (g->n && g->n->fn)
277                                                                         printf("%s:%d", g->n->fn->name, g->n->ln);
278                                                                 printf("\n");
279                                                         }
280                                                         Escape_Check--;
281                                                         return g;
282                                 }       }       }
283                                 Escape_Check--;
284                         }
285                         switch (e->n->ntyp) {
286                         case ASGN:
287                                 if (check_track(e->n) == STRUCT) { break; }
288                                 /* else fall thru */
289                         case TIMEOUT: case RUN:
290                         case PRINT: case PRINTM:
291                         case C_CODE: case C_EXPR:
292                         case ASSERT:
293                         case 's': case 'r': case 'c':
294                                 /* toplevel statements only */
295                                 LastStep = e;
296                         default:
297                                 break;
298                         }
299                         if (Rvous)
300                         {
301                                 return (eval_sync(e))?e->nxt:ZE;
302                         }
303                         return (eval(e->n))?e->nxt:ZE;
304                 }
305         }
306         return ZE; /* not reached */
307 }
308
309 static int
310 eval_sync(Element *e)
311 {       /* allow only synchronous receives
312            and related node types    */
313         Lextok *now = (e)?e->n:ZN;
314
315         if (!now
316         ||  now->ntyp != 'r'
317         ||  now->val >= 2       /* no rv with a poll */
318         ||  !q_is_sync(now))
319         {
320                 return 0;
321         }
322
323         LastStep = e;
324         return eval(now);
325 }
326
327 static int
328 assign(Lextok *now)
329 {       int t;
330
331         if (TstOnly) return 1;
332
333         switch (now->rgt->ntyp) {
334         case FULL:      case NFULL:
335         case EMPTY:     case NEMPTY:
336         case RUN:       case LEN:
337                 t = BYTE;
338                 break;
339         default:
340                 t = Sym_typ(now->rgt);
341                 break;
342         }
343         typ_ck(Sym_typ(now->lft), t, "assignment");
344
345         return setval(now->lft, eval(now->rgt));
346 }
347
348 static int
349 nonprogress(void)       /* np_ */
350 {       RunList *r;
351
352         for (r = run; r; r = r->nxt)
353         {       if (has_lab(r->pc, 4))  /* 4=progress */
354                         return 0;
355         }
356         return 1;
357 }
358
359 int
360 eval(Lextok *now)
361 {
362         if (now) {
363         lineno = now->ln;
364         Fname  = now->fn;
365 #ifdef DEBUG
366         printf("eval ");
367         comment(stdout, now, 0);
368         printf("\n");
369 #endif
370         switch (now->ntyp) {
371         case CONST: return now->val;
372         case   '!': return !eval(now->lft);
373         case  UMIN: return -eval(now->lft);
374         case   '~': return ~eval(now->lft);
375
376         case   '/': return (eval(now->lft) / eval(now->rgt));
377         case   '*': return (eval(now->lft) * eval(now->rgt));
378         case   '-': return (eval(now->lft) - eval(now->rgt));
379         case   '+': return (eval(now->lft) + eval(now->rgt));
380         case   '%': return (eval(now->lft) % eval(now->rgt));
381         case    LT: return (eval(now->lft) <  eval(now->rgt));
382         case    GT: return (eval(now->lft) >  eval(now->rgt));
383         case   '&': return (eval(now->lft) &  eval(now->rgt));
384         case   '^': return (eval(now->lft) ^  eval(now->rgt));
385         case   '|': return (eval(now->lft) |  eval(now->rgt));
386         case    LE: return (eval(now->lft) <= eval(now->rgt));
387         case    GE: return (eval(now->lft) >= eval(now->rgt));
388         case    NE: return (eval(now->lft) != eval(now->rgt));
389         case    EQ: return (eval(now->lft) == eval(now->rgt));
390         case    OR: return (eval(now->lft) || eval(now->rgt));
391         case   AND: return (eval(now->lft) && eval(now->rgt));
392         case LSHIFT: return (eval(now->lft) << eval(now->rgt));
393         case RSHIFT: return (eval(now->lft) >> eval(now->rgt));
394         case   '?': return (eval(now->lft) ? eval(now->rgt->lft)
395                                            : eval(now->rgt->rgt));
396
397         case     'p': return remotevar(now);    /* _p for remote reference */
398         case     'q': return remotelab(now);
399         case     'R': return qrecv(now, 0);     /* test only    */
400         case     LEN: return qlen(now);
401         case    FULL: return (qfull(now));
402         case   EMPTY: return (qlen(now)==0);
403         case   NFULL: return (!qfull(now));
404         case  NEMPTY: return (qlen(now)>0);
405         case ENABLED: if (s_trail) return 1;
406                       return pc_enabled(now->lft);
407
408         case GET_P: return get_priority(now->lft);
409         case SET_P: set_priority(now->lft->lft, now->lft->rgt); return 1;
410
411         case    EVAL: return eval(now->lft);
412         case  PC_VAL: return pc_value(now->lft);
413         case NONPROGRESS: return nonprogress();
414         case    NAME: return getval(now);
415
416         case TIMEOUT: return Tval;
417         case     RUN: return TstOnly?1:enable(now);
418
419         case   's': return qsend(now);          /* send         */
420         case   'r': return qrecv(now, 1);       /* receive or poll */
421         case   'c': return eval(now->lft);      /* condition    */
422         case PRINT: return TstOnly?1:interprint(stdout, now);
423         case PRINTM: return TstOnly?1:printm(stdout, now);
424         case  ASGN:
425                 if (check_track(now) == STRUCT) { return 1; }
426                 return assign(now);
427
428         case C_CODE: if (!analyze)
429                      {  printf("%s:\t", now->sym->name);
430                         plunk_inline(stdout, now->sym->name, 0, 1);
431                      }
432                      return 1; /* uninterpreted */
433
434         case C_EXPR: if (!analyze)
435                      {  printf("%s:\t", now->sym->name);
436                         plunk_expr(stdout, now->sym->name);
437                         printf("\n");
438                      }
439                      return 1; /* uninterpreted */
440
441         case ASSERT: if (TstOnly || eval(now->lft)) return 1;
442                      non_fatal("assertion violated", (char *) 0);
443                         printf("spin: text of failed assertion: assert(");
444                         comment(stdout, now->lft, 0);
445                         printf(")\n");
446                      if (s_trail && !xspin) return 1;
447                      wrapup(1); /* doesn't return */
448
449         case  IF: case DO: case BREAK: case UNLESS:     /* compound */
450         case   '.': return 1;   /* return label for compound */
451         case   '@': return 0;   /* stop state */
452         case  ELSE: return 1;   /* only hit here in guided trails */
453
454         case ',':       /* reached through option -A with array initializer */
455         case 0:
456                     return 0;   /* not great, but safe */
457
458         default   : printf("spin: bad node type %d (run)\n", now->ntyp);
459                     if (s_trail) printf("spin: trail file doesn't match spec?\n");
460                     fatal("aborting", 0);
461         }}
462         return 0;
463 }
464
465 int
466 printm(FILE *fd, Lextok *n)
467 {       extern char Buf[];
468         int j;
469
470         Buf[0] = '\0';
471         if (!no_print)
472         if (!s_trail || depth >= jumpsteps) {
473                 if (n->lft->ismtyp)
474                         j = n->lft->val;
475                 else
476                         j = eval(n->lft);
477                 sr_buf(j, 1);
478                 dotag(fd, Buf);
479         }
480         return 1;
481 }
482
483 int
484 interprint(FILE *fd, Lextok *n)
485 {       Lextok *tmp = n->lft;
486         char c, *s = n->sym->name;
487         int i, j; char lbuf[512]; /* matches value in sr_buf() */
488         extern char Buf[];      /* global, size 4096 */
489         char tBuf[4096];        /* match size of global Buf[] */
490
491         Buf[0] = '\0';
492         if (!no_print)
493         if (!s_trail || depth >= jumpsteps) {
494         for (i = 0; i < (int) strlen(s); i++)
495                 switch (s[i]) {
496                 case '\"': break; /* ignore */
497                 case '\\':
498                          switch(s[++i]) {
499                          case 't': strcat(Buf, "\t"); break;
500                          case 'n': strcat(Buf, "\n"); break;
501                          default:  goto onechar;
502                          }
503                          break;
504                 case  '%':
505                          if ((c = s[++i]) == '%')
506                          {      strcat(Buf, "%"); /* literal */
507                                 break;
508                          }
509                          if (!tmp)
510                          {      non_fatal("too few print args %s", s);
511                                 break;
512                          }
513                          j = eval(tmp->lft);
514                          tmp = tmp->rgt;
515                          switch(c) {
516                          case 'c': sprintf(lbuf, "%c", j); break;
517                          case 'd': sprintf(lbuf, "%d", j); break;
518
519                          case 'e': strcpy(tBuf, Buf);   /* event name */
520                                    Buf[0] = '\0';
521                                    sr_buf(j, 1);
522                                    strcpy(lbuf, Buf);
523                                    strcpy(Buf, tBuf);
524                                    break;
525
526                          case 'o': sprintf(lbuf, "%o", j); break;
527                          case 'u': sprintf(lbuf, "%u", (unsigned) j); break;
528                          case 'x': sprintf(lbuf, "%x", j); break;
529                          default:  non_fatal("bad print cmd: '%s'", &s[i-1]);
530                                    lbuf[0] = '\0'; break;
531                          }
532                          goto append;
533                 default:
534 onechar:                 lbuf[0] = s[i]; lbuf[1] = '\0';
535 append:                  strcat(Buf, lbuf);
536                          break;
537                 }
538                 dotag(fd, Buf);
539         }
540         if (strlen(Buf) >= 4096) fatal("printf string too long", 0);
541         return 1;
542 }
543
544 static int
545 Enabled1(Lextok *n)
546 {       int i; int v = verbose;
547
548         if (n)
549         switch (n->ntyp) {
550         case 'c':
551                 if (has_typ(n->lft, RUN))
552                         return 1;       /* conservative */
553                 /* else fall through */
554         default:        /* side-effect free */
555                 verbose = 0;
556                 E_Check++;
557                 i = eval(n);
558                 E_Check--;
559                 verbose = v;
560                 return i;
561
562         case SET_P:
563         case C_CODE: case C_EXPR:
564         case PRINT: case PRINTM:
565         case   ASGN: case ASSERT:
566                 return 1;
567
568         case 's':
569                 if (q_is_sync(n))
570                 {       if (Rvous) return 0;
571                         TstOnly = 1; verbose = 0;
572                         E_Check++;
573                         i = eval(n);
574                         E_Check--;
575                         TstOnly = 0; verbose = v;
576                         return i;
577                 }
578                 return (!qfull(n));
579         case 'r':
580                 if (q_is_sync(n))
581                         return 0;       /* it's never a user-choice */
582                 n->ntyp = 'R'; verbose = 0;
583                 E_Check++;
584                 i = eval(n);
585                 E_Check--;
586                 n->ntyp = 'r'; verbose = v;
587                 return i;
588         }
589         return 0;
590 }
591
592 int
593 Enabled0(Element *e)
594 {       SeqList *z;
595
596         if (!e || !e->n)
597                 return 0;
598
599         switch (e->n->ntyp) {
600         case '@':
601                 return X->pid == (nproc-nstop-1);
602         case '.':
603         case SET_P:
604                 return 1;
605         case GOTO:
606                 if (Rvous) return 0;
607                 return 1;
608         case UNLESS:
609                 return Enabled0(e->sub->this->frst);
610         case ATOMIC:
611         case D_STEP:
612         case NON_ATOMIC:
613                 return Enabled0(e->n->sl->this->frst);
614         }
615         if (e->sub)     /* true for IF, DO, and UNLESS */
616         {       for (z = e->sub; z; z = z->nxt)
617                         if (Enabled0(z->this->frst))
618                                 return 1;
619                 return 0;
620         }
621         for (z = e->esc; z; z = z->nxt)
622         {       if (Enabled0(z->this->frst))
623                         return 1;
624         }
625 #if 0
626         printf("enabled1 ");
627         comment(stdout, e->n, 0);
628         printf(" ==> %s\n", Enabled1(e->n)?"yes":"nope");
629 #endif
630         return Enabled1(e->n);
631 }
632
633 int
634 pc_enabled(Lextok *n)
635 {       int i = nproc - nstop;
636         int pid = eval(n);
637         int result = 0;
638         RunList *Y, *oX;
639
640         if (pid == X->pid)
641                 fatal("used: enabled(pid=thisproc) [%s]", X->n->name);
642
643         for (Y = run; Y; Y = Y->nxt)
644                 if (--i == pid)
645                 {       oX = X; X = Y;
646                         result = Enabled0(X->pc);
647                         X = oX;
648                         break;
649                 }
650         return result;
651 }
652
653 int
654 pc_highest(Lextok *n)
655 {       int i = nproc - nstop;
656         int pid = eval(n);
657         int target = 0, result = 1;
658         RunList *Y, *oX;
659
660         if (X->prov && !eval(X->prov)) return 0; /* can't be highest unless fully enabled */
661
662         for (Y = run; Y; Y = Y->nxt)
663         {       if (--i == pid)
664                 {       target = Y->priority;
665                         break;
666         }       }
667 if (0) printf("highest for pid %d @ priority = %d\n", pid, target);
668
669         oX = X;
670         i = nproc - nstop;
671         for (Y = run; Y; Y = Y->nxt)
672         {       i--;
673 if (0) printf(" pid %d @ priority %d\t", Y->pid, Y->priority);
674                 if (Y->priority > target)
675                 {       X = Y;
676 if (0) printf("enabled: %s\n", Enabled0(X->pc)?"yes":"nope");
677 if (0) printf("provided: %s\n", eval(X->prov)?"yes":"nope");
678                         if (Enabled0(X->pc) && (!X->prov || eval(X->prov)))
679                         {       result = 0;
680                                 break;
681                 }       }
682 else
683 if (0) printf("\n");
684         }
685         X = oX;
686
687         return result;
688 }
689
690 int
691 get_priority(Lextok *n)
692 {       int i = nproc - nstop;
693         int pid = eval(n);
694         RunList *Y;
695
696         if (old_priority_rules)
697         {       return 1;
698         }
699
700         for (Y = run; Y; Y = Y->nxt)
701         {       if (--i == pid)
702                 {       return Y->priority;
703         }       }
704         return 0;
705 }
706
707 void
708 set_priority(Lextok *n, Lextok *p)
709 {       int i = nproc - nstop - Have_claim;
710         int pid = eval(n);
711         RunList *Y;
712
713         if (old_priority_rules)
714         {       return;
715         }
716         for (Y = run; Y; Y = Y->nxt)
717         {       if (--i == pid)
718                 {       Priority_Sum -= Y->priority;
719                         Y->priority = eval(p);
720                         Priority_Sum += Y->priority;
721                         if (1)
722                         {       printf("%3d: setting priority of proc %d (%s) to %d\n",
723                                         depth, pid, Y->n->name, Y->priority);
724         }       }       }
725         if (verbose&32)
726         {       printf("\tPid\tName\tPriority\n");
727                 for (Y = run; Y; Y = Y->nxt)
728                 {       printf("\t%d\t%s\t%d\n",
729                                 Y->pid,
730                                 Y->n->name,
731                                 Y->priority);
732         }       }
733 }