summaryrefslogtreecommitdiffstats
path: root/syntax/smt2.vim
blob: adb88d28a37bc48208be330869358384ccc4d534 (plain) (blame)
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
if has_key(g:polyglot_is_disabled, 'smt2')
  finish
endif

" Vim syntax file
" " Language:     SMT-LIB2 with Z3's extensions
" " Maintainer:   Dimitri Bohlender <bohlender@embedded.rwth-aachen.de>

" Quit if a syntax file is already loaded
if exists("b:current_syntax")
  finish
endif
let b:current_syntax = "smt2"

" Comments
syntax match smt2Comment ";.*$"

" Commands
syntax keyword smt2Commands
      \ apply
      \ assert
      \ assert-soft
      \ check-sat
      \ check-sat-assuming
      \ check-sat-using
      \ declare-const
      \ declare-datatype
      \ declare-datatypes
      \ declare-fun
      \ declare-map
      \ declare-rel
      \ declare-sort
      \ declare-var
      \ define-const
      \ define-fun
      \ define-fun-rec
      \ define-funs-rec
      \ define-sort
      \ display
      \ echo
      \ elim-quantifiers
      \ eval
      \ exit
      \ get-assertions
      \ get-assignment
      \ get-info
      \ get-model
      \ get-option
      \ get-proof
      \ get-unsat-assumptions
      \ get-unsat-core
      \ get-user-tactics
      \ get-value
      \ help
      \ maximize
      \ minimize
      \ pop
      \ push
      \ query
      \ reset
      \ reset-assertions
      \ rule
      \ set-info
      \ set-logic
      \ set-option
      \ simplify
syntax match smt2Commands "!"

" Operators
syntax match smt2Operator "[=\|>\|<\|<=\|>=\|=>\|+\|\-\|*\|/\|!]"

" Builtins
syntax keyword smt2Builtin
      \ and
      \ as
      \ bit0
      \ bit1
      \ bvadd
      \ bvand
      \ bvashr
      \ bvcomp
      \ bvlshr
      \ bvmul
      \ bvnand
      \ bvneg
      \ bvnor
      \ bvnot
      \ bvor
      \ bvredand
      \ bvredor
      \ bvsdiv
      \ bvsge
      \ bvsgt
      \ bvshl
      \ bvsle
      \ bvslt
      \ bvsmod
      \ bvsrem
      \ bvsub
      \ bvudiv
      \ bvuge
      \ bvugt
      \ bvule
      \ bvult
      \ bvurem
      \ bvxnor
      \ bvxor
      \ concat
      \ const
      \ distinct
      \ div
      \ exists
      \ extract
      \ false
      \ forall
      \ if
      \ is_int
      \ ite
      \ let
      \ map
      \ match
      \ mod
      \ not
      \ or
      \ par
      \ rem
      \ repeat
      \ root-obj
      \ rotate_left
      \ rotate_right
      \ sat
      \ sat
      \ select
      \ sign_extend
      \ store
      \ to_int
      \ to_real
      \ true
      \ unsat
      \ unsat
      \ xor
      \ zero_extend
syntax match smt2Builtin "[\^\~]"

" Identifier
syntax match smt2Identifier "\<[a-z_][a-zA-Z0-9_\-\.']*\>"

" Types
syntax match smt2Type "\<[A-Z][a-zA-Z0-9_\-\.']*\>"

" Strings
syntax region smt2String start=+"+ skip=+\\\\\|\\"+ end=+"+
syntax match smt2Option "\<:[a-zA-Z0-9_\-\.']*\>"

" Constructors
syntax match smt2Constructor "\<\$[a-zA-Z0-9_\-\.']*\>"

" Number
syntax match smt2Int "\<[0-9]\+\>"
syntax match smt2Hex "\<[0#][xX][0-9a-fA-F]\+\>"
syntax match smt2Binary "\<#b[01]\+\>"
syntax match smt2Float "\<[0-9]\+\.[0-9]\+\([eE][\-+]\=[0-9]\+\)\=\>"

" Delimiter
syntax match smt2Delimiter "[()]"

" Error
syntax keyword smt2Error error

highlight def link smt2Comment     Comment
highlight def link smt2Commands    Function
highlight def link smt2Operator    Operator
highlight def link smt2Builtin     Operator
highlight def link smt2Identifier  Normal
highlight def link smt2Type        Type
highlight def link smt2String      String
highlight def link smt2Option      PreProc
highlight def link smt2Constructor Function
highlight def link smt2Float       Float
highlight def link smt2Hex         Number
highlight def link smt2Binary      Number
highlight def link smt2Int         Number
highlight def link smt2Delimiter   Delimiter
highlight def link smt2Error       Error