summaryrefslogtreecommitdiff
path: root/sheets/b.ssh
blob: 6293b85a7895dfeaeaac8aacefeda4f7b1aa0336 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#
# Style sheet for the B language
# Copyright (c) 1999 Philippe Coucaud
#

#
# This file is part of a2ps.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; see the file COPYING.  If not, write to
# the Free Software Foundation, 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
#

style B is

written by "Philippe Coucaud <coucaud@loria.fr>"
requires a2ps 4.12a

version is 1.1
# 1.0 initial release
# 1.1 new operators added (/=, : {, ||, &)

documentation is
  "B is a formal specification method mostly used to describe critical"
  "systems.  It is based on the mathematical sets theory."
end documentation

first alphabet is
   "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
second alphabet is
   "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_"


# B is case sensitive
case sensitive


keywords in Keyword_strong are
   ANY, ASSERTIONS,
   BE, BEGIN, BOOL,
   CASE, CHOICE, CONSTANTS, CONSTRAINTS,
   DEFINITIONS, DO,
   EITHER, ELSE, ELSIF, END, EXTENDS,
   FALSE, FIN, FIN1,
   IF, IMPLEMENTATION, IMPORTS, IN, INCLUDES, INITIALISATION, INT, INTEGER, INTER, INVARIANT,
   LET,
   MACHINE, MAXINT, MININT,
   NAT, NAT1, NATURAL, NATURAL1,
   OF, OPERATIONS, OR,
   PI, POW, POW1, PRE, PROMOTES, PROPERTIES,
   REFINES, REFINEMENT,
   SEES, SELECT, SETS, SIGMA, STRING,
   THEN, TRUE,
   USES, UNION,
   VALUES, VAR, VARIABLES, VARIANT,
   WHEN, WHERE, WHILE
end keywords

keywords in Keyword_strong are
   bool,
   card, closure, closure1, conc,
   dom,
   "first", fnc, front,
   id, iseq, iseq1, iterate,  inter,
   last,
   max, min, mod,
   not,
   or,
   perm, pred, prj1, prj2,
   ran, rel, rev,
   seq, seq1, size, skip, succ,
   tail,
   union
end keywords

operators are
   <-- \leftarrow,
   --> \rightarrow,
   := ,
   :: ,
# try to use the mathematical notation for sets
   (/:([ \t]*)({)/   \in , \1 Plain, \2 Plain ),
# "/:" is not ambigous (no need to see if a set definition follows)
   "/:" \not\in,
   <=>  \Leftrightarrow,
   => \Rightarrow,
   <= \leq,
   >= \geq,
   <,
   >,
# don't know if B users would appreciate a mathematical \/ (using the
# symbol font) for the || operator (a la C)?
  || \vee,
# same question for the & operator ( /\ ??)
  & \wedge,
  "/=" \neq
end operators

sequences are
    "/*" Comment "*/"
end sequences

end style