# 2.11BSD#431 - /usr/src/new/PORT/B/src/bsmall/b1obj.h

##### Macros

    Field             X
    Formal            X
    Funprd            X
    How_to            X
    Is_ELT            X
    Is_compound       X
    Is_filed          X
    Is_formal         X
    Is_function       X
    Is_howto          X
    Is_list           X
    Is_number         X
    Is_predicate      X
    Is_refinement     X
    Is_shared         X
    Is_simploc        X
    Is_table          X
    Is_tbseloc        X
    Is_text           X
    Is_tlt            X
    Is_trimloc        X
    Lastfield         X
    Nfields           X
    Refinement        X
    Simploc           X
    Tbseloc           X
    Trimloc           X
    k_Overfields      X
    mk_compound       X

       1: /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1984. */
       2: /* $Header: b1obj.h,v 1.1 84/06/28 00:48:43 timo Exp $ */
       3:
       4: /* B values, locations, environments: the B abstract machine */
       5:
       6: /****************************** general ******************************/
       7:
       8: typedef intlet relation; /* < 0, == 0, > 0 */
       9: relation compare();
      10:
      11: #define Is_text(v) (Type(v) == Tex)
      12: #define Is_number(v) (Type(v) == Num)
      13: #define Is_compound(v) (Type(v) == Com)
      14: #define Is_list(v) (Type(v) == Lis || Type(v) == ELT)
      15: #define Is_table(v) (Type(v) == Tab || Type(v) == ELT)
      16: #define Is_tlt(v) (Type(v)==Tex || Type(v)==Lis || Type(v)==Tab || Type(v)==ELT)
      17: #define Is_ELT(v) (Type(v) == ELT)
      18:
      19: #define Is_simploc(v) (Type(v) == Sim)
      20: #define Is_tbseloc(v) (Type(v) == Tse)
      21: #define Is_trimloc(v) (Type(v) == Tri)
      22: #define Is_refinement(v) (Type(v) == Ref)
      23: #define Is_formal(v) (Type(v) == For)
      24: #define Is_shared(v) (Type(v) == Glo)
      25: #define Is_filed(v) (Type(v) == Per)
      26: #define Is_function(v) (Type(v) == Fun)
      27: #define Is_predicate(v) (Type(v) == Prd)
      28: #define Is_howto(v) (Type(v) == How)
      29:
      30: value grab_num();
      31: value regrab_num();
      32: value grab_rat();
      33: value grab_approx();
      34: value grab_tex();
      35: value grab_com();
      36: value grab_elt();
      37: value grab_lis();
      38: value grab_tab();
      39: value grab_sim();
      40: value grab_tri();
      41: value grab_tse();
      42: value grab_how();
      43: value grab_for();
      44: value grab_glo();
      45: value grab_per();
      46: value grab_fun();
      47: value grab_prd();
      48: value grab_ref();
      49:
      50: value copy();
      51: /* Procedure release(); */
      52: /* Procedure uniql(); */
      53: /* Procedure uniq_assoc(); */
      54: double hash();
      55:
      56: /****************************** Texts ******************************/
      57: string strcpy(), strncpy(), strcat(), sprintf(), index();
      58:
      59: bool character();
      60:
      61: value mk_text();
      62: char charval();
      63: string strval();
      64:
      65: value concat();
      66: value behead();
      67: value curtail();
      68: value trim();
      69: value repeat();
      70:
      71: value adjleft();
      72: value centre();
      73: value adjright();
      74:
      75: value convert();
      76:
      77: /****************************** Numbers ******************************/
      78:
      79: /* Predicates */
      80: bool integral();        /* is the value an integer? */
      81: bool large();       /* can a number be represented by a C int? */
      82:
      83: /* Constants */
      84: extern value zero, one;
      85:
      86: /* Conversion of abstract values to concrete objects */
      87: double numval();     /* numeric value of any number */
      88: int intval();        /* numeric value of integral number */
      89: intlet propintlet(); /* converts int to intlet */
      90: string convnum();    /* character string approximation of any number */
      91: int numcomp();       /* Comparison of two numbers: yields -1, 0 or 1 */
      92: double numhash();    /* Hashes any abstract number to a 'double' */
      93:
      94: /* Conversion of concrete objects to abstract numbers */
      95: value numconst();    /* string argument */
      96: value mk_integer();  /* int argument */
      97:
      98: /* Functions on numbers */
      99: value sum();
     100: value diff();
     101: value negated();
     102: value prod();
     103: value quot();
     104: value modulo();
     105: value floorf();
     106: value ceilf();
     107: value round1();
     108: value round2();
     109: value mod();
     110: value power();
     111: value absval();
     112: value signum();
     113: value numerator();
     114: value denominator();
     115: value approximate();
     116: value random();
     117: value root1();
     118: value sin1();
     119: value cos1();
     120: value tan1();
     121: value atn1();
     122: value exp1();
     123: value log1();
     124: value root2();
     125: value atn2();
     126: value log2();
     127: value pi();
     128: value e();
     129:
     130: /****************************** Compounds ******************************/
     131: #define Nfields(c) Length(c)
     132: #define Field(c, i) ((Ats(c)+(i)))
     133: #define k_Overfields for (k= 0; k < len; k++)
     134: #define Lastfield(k) ((k) == len-1)
     135:
     136: #define mk_compound(len) grab_com(len)
     137:
     138: value* field();
     139: /* Procedure put_in_field(); */
     140:
     141: /****************************** Lists ******************************/
     142: value mk_numrange();
     143: value mk_charrange();
     144:
     145: /* Procedurre insert(); */
     146: /* Procedure remove(); */
     147:
     148: /****************************** Tables ******************************/
     149:
     150: value keys();
     151: bool in_keys();
     152: value associate();
     153:
     154: /* Procedure replace(); */
     155: /* Procedure delete(); */
     156:
     157: value* adrassoc();
     158: value* key();
     159: value* assoc();
     160:
     161: /****************************** Texts, Lists, and Tables *******************/
     162: value mk_elt();
     163:
     164: bool in();
     165:
     166: value size();
     167: value size2();
     168: value min1();
     169: value min2();
     170: value max1();
     171: value max2();
     172: value th_of();
     173: value thof();
     174:
     175: int length(); /* The same as size, temporary until part2 is written in B */
     176: bool empty(); /* whether #v=0: also temporary */
     177:
     178: /****************************** Other kinds of value ************************/
     179:
     180: #define Simploc(l) ((simploc *)Ats(l))
     181: #define Tbseloc(l) ((tbseloc *)Ats(l))
     182: #define Trimloc(l) ((trimloc *)Ats(l))
     183: #define Funprd(f)  ((funprd *)Ats(f))
     184: #define How_to(u)  ((how *)Ats(u))
     185: #define Formal(p)  ((formal *)Ats(f))
     186: #define Refinement(r) ((ref *)Ats(r))
     187:
     188: loc mk_simploc();
     189: loc mk_trimloc();
     190: loc mk_tbseloc();
     191:
     192: value mk_per();
     193: fun mk_fun();
     194: prd mk_prd();
     195: value mk_how();
     196: value mk_ref();

#### Defined macros

Field defined in line 132; used 1 times

- in /usr/src/new/PORT/B/src/bsmall/b1com.c line 16

Formal defined in line 185; used 3 times

- in /usr/src/new/PORT/B/src/bsmall/b2uni.c line 128, 203, 213

Funprd defined in line 183; used 4 times

- in /usr/src/new/PORT/B/src/bsmall/b2exp.c line 64-67(2)
- in /usr/src/new/PORT/B/src/bsmall/b2fpr.c line 204, 232

How_to defined in line 184; used 3 times

- in /usr/src/new/PORT/B/src/bsmall/b2sou.c line 249
- in /usr/src/new/PORT/B/src/bsmall/b2uni.c line 155, 194

Is_ELT defined in line 17; used 7 times

- in /usr/src/new/PORT/B/src/bsmall/B1lis.c line 19
- in /usr/src/new/PORT/B/src/bsmall/b2scr.c line 152
- in /usr/src/new/PORT/B/src/bsmall/b2typ.c line 65, 95-96(4)

Is_compound defined in line 13; used 14 times

- in /usr/src/new/PORT/B/src/bsmall/b2cmd.c line 279
- in /usr/src/new/PORT/B/src/bsmall/b2loc.c line 45, 101-103(2), 122, 145, 198
- in /usr/src/new/PORT/B/src/bsmall/b2scr.c line 115, 138
- in /usr/src/new/PORT/B/src/bsmall/b2tes.c line 158
- in /usr/src/new/PORT/B/src/bsmall/b2typ.c line 48, 61, 97(2)

Is_filed defined in line 25; used 4 times

- in /usr/src/new/PORT/B/src/bsmall/b2exp.c line 228-231(2)
- in /usr/src/new/PORT/B/src/bsmall/b2sou.c line 380, 453

Is_formal defined in line 23; used 4 times

- in /usr/src/new/PORT/B/src/bsmall/b2exp.c line 223
- in /usr/src/new/PORT/B/src/bsmall/b2tar.c line 48
- in /usr/src/new/PORT/B/src/bsmall/b2uni.c line 204, 214

Is_function defined in line 26; used 2 times

- in /usr/src/new/PORT/B/src/bsmall/b2fpr.c line 112, 202

Is_howto defined in line 28; used 1 times

- in /usr/src/new/PORT/B/src/bsmall/b2uni.c line 150

Is_list defined in line 14; used 8 times

- in /usr/src/new/PORT/B/src/bsmall/B1lis.c line 17, 36
- in /usr/src/new/PORT/B/src/bsmall/b2scr.c line 152
- in /usr/src/new/PORT/B/src/bsmall/b2typ.c line 67, 95-101(4)

Is_number defined in line 12; used 8 times

- in /usr/src/new/PORT/B/src/bsmall/b2exp.c line 420, 427
- in /usr/src/new/PORT/B/src/bsmall/b2fpr.c line 215-218(2)
- in /usr/src/new/PORT/B/src/bsmall/b2scr.c line 117
- in /usr/src/new/PORT/B/src/bsmall/b2typ.c line 59, 93(2)

Is_predicate defined in line 27; used 2 times

- in /usr/src/new/PORT/B/src/bsmall/b2fpr.c line 114, 230

Is_refinement defined in line 22; used 5 times

- in /usr/src/new/PORT/B/src/bsmall/b2exp.c line 220
- in /usr/src/new/PORT/B/src/bsmall/b2tar.c line 46
- in /usr/src/new/PORT/B/src/bsmall/b2tes.c line 60
- in /usr/src/new/PORT/B/src/bsmall/b2uni.c line 240, 312

Is_shared defined in line 24; used 2 times

- in /usr/src/new/PORT/B/src/bsmall/b2exp.c line 226
- in /usr/src/new/PORT/B/src/bsmall/b2tar.c line 50

Is_simploc defined in line 19; used 11 times

- in /usr/src/new/PORT/B/src/bsmall/b2cmd.c line 279
- in /usr/src/new/PORT/B/src/bsmall/b2loc.c line 13, 29, 62, 71, 81, 116, 137, 194
- in /usr/src/new/PORT/B/src/bsmall/b2tes.c line 158
- in /usr/src/new/PORT/B/src/bsmall/b2typ.c line 34

Is_table defined in line 15; used 12 times

- in /usr/src/new/PORT/B/src/bsmall/B1tab.c line 20
- in /usr/src/new/PORT/B/src/bsmall/b2env.c line 78-88(3)
- in /usr/src/new/PORT/B/src/bsmall/b2loc.c line 40
- in /usr/src/new/PORT/B/src/bsmall/b2scr.c line 166
- in /usr/src/new/PORT/B/src/bsmall/b2typ.c line 74, 95-96(2), 106(2)
- in /usr/src/new/PORT/B/src/bsmall/b2uni.c line 533

Is_tbseloc defined in line 20; used 9 times

- in /usr/src/new/PORT/B/src/bsmall/b2loc.c line 17, 35, 62, 71, 108, 126, 148, 203
- in /usr/src/new/PORT/B/src/bsmall/b2typ.c line 38

Is_text defined in line 11; used 19 times

- in /usr/src/new/PORT/B/src/bsmall/B1tex.c line 17-22(2)
- in /usr/src/new/PORT/B/src/bsmall/B1tlt.c line 165-166(2), 184-185(2)
- in /usr/src/new/PORT/B/src/bsmall/b2err.c line 47
- in /usr/src/new/PORT/B/src/bsmall/b2exp.c line 258, 438-443(2)
- in /usr/src/new/PORT/B/src/bsmall/b2loc.c line 89-90(2)
- in /usr/src/new/PORT/B/src/bsmall/b2scr.c line 114, 123
- in /usr/src/new/PORT/B/src/bsmall/b2tar.c line 69
- in /usr/src/new/PORT/B/src/bsmall/b2tes.c line 163
- in /usr/src/new/PORT/B/src/bsmall/b2typ.c line 60, 94(2)

Is_tlt defined in line 16; used 10 times

- in /usr/src/new/PORT/B/src/bsmall/B1tlt.c line 11, 19, 156, 163, 175, 182, 199, 247
- in /usr/src/new/PORT/B/src/bsmall/b2loc.c line 176
- in /usr/src/new/PORT/B/src/bsmall/b2tes.c line 168

Is_trimloc defined in line 21; used 7 times

- in /usr/src/new/PORT/B/src/bsmall/b2loc.c line 44, 59, 84, 119, 143, 201
- in /usr/src/new/PORT/B/src/bsmall/b2typ.c line 46

Lastfield defined in line 134; used 7 times

- in /usr/src/new/PORT/B/src/bsmall/b2exp.c line 103-107(2)
- in /usr/src/new/PORT/B/src/bsmall/b2scr.c line 144
- in /usr/src/new/PORT/B/src/bsmall/b2tar.c line 26-30(2)
- in /usr/src/new/PORT/B/src/bsmall/b2uni.c line 405-409(2)

Nfields defined in line 131; used 13 times

- in /usr/src/new/PORT/B/src/bsmall/b2loc.c line 102-105(3), 123, 146, 199
- in /usr/src/new/PORT/B/src/bsmall/b2scr.c line 139
- in /usr/src/new/PORT/B/src/bsmall/b2typ.c line 49(2), 62(2), 98(2)

Refinement defined in line 186; used 5 times

- in /usr/src/new/PORT/B/src/bsmall/b2uni.c line 245-246(2), 347-348(2), 556

Simploc defined in line 180; used 7 times

- in /usr/src/new/PORT/B/src/bsmall/b2loc.c line 14, 30, 82, 117, 138, 195
- in /usr/src/new/PORT/B/src/bsmall/b2typ.c line 35

Tbseloc defined in line 181; used 6 times

- in /usr/src/new/PORT/B/src/bsmall/b2loc.c line 18, 36, 109, 127, 149
- in /usr/src/new/PORT/B/src/bsmall/b2typ.c line 39

Trimloc defined in line 182; used 2 times

- in /usr/src/new/PORT/B/src/bsmall/b2loc.c line 60, 85

k_Overfields defined in line 133; used 11 times

- in /usr/src/new/PORT/B/src/bsmall/b2exp.c line 102
- in /usr/src/new/PORT/B/src/bsmall/b2loc.c line 107, 124, 147, 200
- in /usr/src/new/PORT/B/src/bsmall/b2scr.c line 142
- in /usr/src/new/PORT/B/src/bsmall/b2tar.c line 25
- in /usr/src/new/PORT/B/src/bsmall/b2typ.c line 50, 63, 99
- in /usr/src/new/PORT/B/src/bsmall/b2uni.c line 404

mk_compound defined in line 136; used 7 times

- in /usr/src/new/PORT/B/src/bsmall/b2exp.c line 53, 59, 101
- in /usr/src/new/PORT/B/src/bsmall/b2tar.c line 24
- in /usr/src/new/PORT/B/src/bsmall/b2typ.c line 49, 62
- in /usr/src/new/PORT/B/src/bsmall/b2uni.c line 403

#### Usage of this include

b1obj.h used 26 times

- in /usr/src/new/PORT/B/src/bsmall/B1fun.c line 6
- in /usr/src/new/PORT/B/src/bsmall/B1lis.c line 6
- in /usr/src/new/PORT/B/src/bsmall/B1num.c line 15
- in /usr/src/new/PORT/B/src/bsmall/B1obj.c line 7
- in /usr/src/new/PORT/B/src/bsmall/B1tab.c line 6
- in /usr/src/new/PORT/B/src/bsmall/B1tex.c line 6
- in /usr/src/new/PORT/B/src/bsmall/B1tlt.c line 5
- in /usr/src/new/PORT/B/src/bsmall/B1val.c line 8
- in /usr/src/new/PORT/B/src/bsmall/b1com.c line 13
- in /usr/src/new/PORT/B/src/bsmall/b1mem.c line 7
- in /usr/src/new/PORT/B/src/bsmall/b2cmd.c line 7
- in /usr/src/new/PORT/B/src/bsmall/b2env.c line 6
- in /usr/src/new/PORT/B/src/bsmall/b2err.c line 7
- in /usr/src/new/PORT/B/src/bsmall/b2exp.c line 7
- in /usr/src/new/PORT/B/src/bsmall/b2fil.c line 10
- in /usr/src/new/PORT/B/src/bsmall/b2fpr.c line 6
- in /usr/src/new/PORT/B/src/bsmall/b2loc.c line 7
- in /usr/src/new/PORT/B/src/bsmall/b2mai.c line 8
- in /usr/src/new/PORT/B/src/bsmall/b2scr.c line 6
- in /usr/src/new/PORT/B/src/bsmall/b2sig.c line 6
- in /usr/src/new/PORT/B/src/bsmall/b2sou.c line 8
- in /usr/src/new/PORT/B/src/bsmall/b2syn.c line 6
- in /usr/src/new/PORT/B/src/bsmall/b2tar.c line 6
- in /usr/src/new/PORT/B/src/bsmall/b2tes.c line 6
- in /usr/src/new/PORT/B/src/bsmall/b2typ.c line 6
- in /usr/src/new/PORT/B/src/bsmall/b2uni.c line 6

Last modified: 1985-08-27 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: 1224 |