-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathast_8c-example.html
378 lines (376 loc) · 51.8 KB
/
ast_8c-example.html
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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Clingo C API: ast.c</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="clingo.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Clingo C API
</div>
<div id="projectbrief">C API for clingo providing high level functions to control grounding and solving.</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="headertitle">
<div class="title">ast.c</div> </div>
</div><!--header-->
<div class="contents">
<p>The example shows how to rewrite a non-ground logic program.</p>
<h2><a class="anchor" id="autotoc_md22"></a>
Output</h2>
<div class="fragment"><div class="line">./ast 0</div>
<div class="line">Solving with enable = <span class="keyword">false</span>...</div>
<div class="line">Model:</div>
<div class="line">Solving with enable = <span class="keyword">true</span>...</div>
<div class="line">Model: enable a</div>
<div class="line">Model: enable b</div>
<div class="line">Solving with enable = <span class="keyword">false</span>...</div>
<div class="line">Model:</div>
</div><!-- fragment --><h2><a class="anchor" id="autotoc_md23"></a>
Code</h2>
<div class="fragment"><div class="line"><span class="preprocessor">#include <<a class="code" href="clingo_8h.html">clingo.h</a>></span></div>
<div class="line"><span class="preprocessor">#include <stdlib.h></span></div>
<div class="line"><span class="preprocessor">#include <stdio.h></span></div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">bool</span> print_model(<a class="code" href="group__Model.html#gaaf9a93819f023f3cb8aa80598c46556b">clingo_model_t</a> <span class="keyword">const</span> *model) {</div>
<div class="line"> <span class="keywordtype">bool</span> ret = <span class="keyword">true</span>;</div>
<div class="line"> <a class="code" href="group__Symbols.html#ga6c75c60fa57c3b97505265ff08f6f951">clingo_symbol_t</a> *atoms = NULL;</div>
<div class="line"> <span class="keywordtype">size_t</span> atoms_n;</div>
<div class="line"> <a class="code" href="group__Symbols.html#ga6c75c60fa57c3b97505265ff08f6f951">clingo_symbol_t</a> <span class="keyword">const</span> *it, *ie;</div>
<div class="line"> <span class="keywordtype">char</span> *str = NULL;</div>
<div class="line"> <span class="keywordtype">size_t</span> str_n = 0;</div>
<div class="line"> </div>
<div class="line"> <span class="comment">// determine the number of (shown) symbols in the model</span></div>
<div class="line"> <span class="keywordflow">if</span> (!<a name="a0"></a><a class="code" href="group__Model.html#ga5c6c30cef0e3a29a192577a1a739ca69">clingo_model_symbols_size</a>(model, <a name="a1"></a><a class="code" href="group__Model.html#gga72e8ba23a84af09dfd93739ebaa6ecf8a82a698ef41cd919cb370d22fc0b44826">clingo_show_type_shown</a>, &atoms_n)) { <span class="keywordflow">goto</span> error; }</div>
<div class="line"> </div>
<div class="line"> <span class="comment">// allocate required memory to hold all the symbols</span></div>
<div class="line"> <span class="keywordflow">if</span> (!(atoms = (<a class="code" href="group__Symbols.html#ga6c75c60fa57c3b97505265ff08f6f951">clingo_symbol_t</a>*)malloc(<span class="keyword">sizeof</span>(*atoms) * atoms_n))) {</div>
<div class="line"> <a name="a2"></a><a class="code" href="group__BasicTypes.html#ga5c2b2943475239e151eb783d30548b38">clingo_set_error</a>(<a name="a3"></a><a class="code" href="group__BasicTypes.html#ggaebdf91a4187db9abdd2c6ceb971cf13eaa14a0926eb3e653fcc13299b33d8d348">clingo_error_bad_alloc</a>, <span class="stringliteral">"could not allocate memory for atoms"</span>);</div>
<div class="line"> <span class="keywordflow">goto</span> error;</div>
<div class="line"> }</div>
<div class="line"> </div>
<div class="line"> <span class="comment">// retrieve the symbols in the model</span></div>
<div class="line"> <span class="keywordflow">if</span> (!<a name="a4"></a><a class="code" href="group__Model.html#ga05d849166d689a3d4ae8d40fba070d91">clingo_model_symbols</a>(model, <a class="code" href="group__Model.html#gga72e8ba23a84af09dfd93739ebaa6ecf8a82a698ef41cd919cb370d22fc0b44826">clingo_show_type_shown</a>, atoms, atoms_n)) { <span class="keywordflow">goto</span> error; }</div>
<div class="line"> </div>
<div class="line"> printf(<span class="stringliteral">"Model:"</span>);</div>
<div class="line"> </div>
<div class="line"> <span class="keywordflow">for</span> (it = atoms, ie = atoms + atoms_n; it != ie; ++it) {</div>
<div class="line"> <span class="keywordtype">size_t</span> n;</div>
<div class="line"> <span class="keywordtype">char</span> *str_new;</div>
<div class="line"> </div>
<div class="line"> <span class="comment">// determine size of the string representation of the next symbol in the model</span></div>
<div class="line"> <span class="keywordflow">if</span> (!<a name="a5"></a><a class="code" href="group__Symbols.html#ga6963e11f6d22a5c04a0e50d1afe1f4f5">clingo_symbol_to_string_size</a>(*it, &n)) { <span class="keywordflow">goto</span> error; }</div>
<div class="line"> </div>
<div class="line"> <span class="keywordflow">if</span> (str_n < n) {</div>
<div class="line"> <span class="comment">// allocate required memory to hold the symbol's string</span></div>
<div class="line"> <span class="keywordflow">if</span> (!(str_new = (<span class="keywordtype">char</span>*)realloc(str, <span class="keyword">sizeof</span>(*str) * n))) {</div>
<div class="line"> <a class="code" href="group__BasicTypes.html#ga5c2b2943475239e151eb783d30548b38">clingo_set_error</a>(<a class="code" href="group__BasicTypes.html#ggaebdf91a4187db9abdd2c6ceb971cf13eaa14a0926eb3e653fcc13299b33d8d348">clingo_error_bad_alloc</a>, <span class="stringliteral">"could not allocate memory for symbol's string"</span>);</div>
<div class="line"> <span class="keywordflow">goto</span> error;</div>
<div class="line"> }</div>
<div class="line"> </div>
<div class="line"> str = str_new;</div>
<div class="line"> str_n = n;</div>
<div class="line"> }</div>
<div class="line"> </div>
<div class="line"> <span class="comment">// retrieve the symbol's string</span></div>
<div class="line"> <span class="keywordflow">if</span> (!<a name="a6"></a><a class="code" href="group__Symbols.html#gac292526ba129269eec3c64510deec3b0">clingo_symbol_to_string</a>(*it, str, n)) { <span class="keywordflow">goto</span> error; }</div>
<div class="line"> </div>
<div class="line"> printf(<span class="stringliteral">" %s"</span>, str);</div>
<div class="line"> }</div>
<div class="line"> </div>
<div class="line"> printf(<span class="stringliteral">"\n"</span>);</div>
<div class="line"> <span class="keywordflow">goto</span> out;</div>
<div class="line"> </div>
<div class="line">error:</div>
<div class="line"> ret = <span class="keyword">false</span>;</div>
<div class="line"> </div>
<div class="line">out:</div>
<div class="line"> <span class="keywordflow">if</span> (atoms) { free(atoms); }</div>
<div class="line"> <span class="keywordflow">if</span> (str) { free(str); }</div>
<div class="line"> </div>
<div class="line"> <span class="keywordflow">return</span> ret;</div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"><span class="keyword">typedef</span> <span class="keyword">struct </span>{</div>
<div class="line"> <a name="_a7"></a><a class="code" href="structclingo__location.html">clingo_location_t</a> *loc;</div>
<div class="line"> <a class="code" href="group__AST.html#ga18cb4e15ed8cfb0b70930fa6bc7accc5">clingo_ast_t</a> *atom;</div>
<div class="line"> <a class="code" href="group__AST.html#gaf3ea2b021e93cdcc0f6c7b4219e4a06d">clingo_program_builder_t</a> *builder;</div>
<div class="line">} on_statement_data;</div>
<div class="line"> </div>
<div class="line"><span class="comment">// adds atom enable to all rule bodies</span></div>
<div class="line"><span class="keywordtype">bool</span> on_statement (<a class="code" href="group__AST.html#ga18cb4e15ed8cfb0b70930fa6bc7accc5">clingo_ast_t</a> *stm, on_statement_data *data) {</div>
<div class="line"> <span class="keywordtype">bool</span> ret = <span class="keyword">true</span>;</div>
<div class="line"> <a class="code" href="group__AST.html#ga18cb4e15ed8cfb0b70930fa6bc7accc5">clingo_ast_t</a> *lit = NULL;</div>
<div class="line"> <a class="code" href="group__AST.html#ga1fe74e0e6ea76c81af7928ad4e1d6f64">clingo_ast_type_t</a> type;</div>
<div class="line"> <span class="keywordtype">size_t</span> size;</div>
<div class="line"> </div>
<div class="line"> <span class="keywordflow">if</span> (!<a name="a8"></a><a class="code" href="group__AST.html#ga8a95127916235f7316274c107dfb688f">clingo_ast_get_type</a>(stm, &type)) { <span class="keywordflow">goto</span> error; }</div>
<div class="line"> </div>
<div class="line"> <span class="comment">// pass through all statements that are not rules</span></div>
<div class="line"> <span class="keywordflow">if</span> (type != clingo_ast_type_rule) {</div>
<div class="line"> <span class="keywordflow">if</span> (!<a name="a9"></a><a class="code" href="group__AST.html#gae269f530da9a010dbfd57b062c0d6758">clingo_program_builder_add</a>(data->builder, stm)) { <span class="keywordflow">goto</span> error; }</div>
<div class="line"> <span class="keywordflow">goto</span> out;</div>
<div class="line"> }</div>
<div class="line"> </div>
<div class="line"> <span class="comment">// create literal "enable"</span></div>
<div class="line"> <span class="keywordflow">if</span> (!<a name="a10"></a><a class="code" href="group__AST.html#ga01a0ea8ed6ef60f53a577dad572a4647">clingo_ast_build</a>(clingo_ast_type_literal, &lit, data->loc, <a name="a11"></a><a class="code" href="group__AST.html#gga6e364e06578fa662c56ded83b6bf14d6a181102f5331f8352f4f603f81010269d">clingo_ast_sign_no_sign</a>, data->atom)) {</div>
<div class="line"> <span class="keywordflow">goto</span> error;</div>
<div class="line"> }</div>
<div class="line"> </div>
<div class="line"> <span class="keywordflow">if</span> (!<a name="a12"></a><a class="code" href="group__AST.html#gacc311f05451081ce654b65610bdf2fd6">clingo_ast_attribute_size_ast_array</a>(stm, clingo_ast_attribute_body, &size)) {</div>
<div class="line"> <span class="keywordflow">goto</span> error;</div>
<div class="line"> }</div>
<div class="line"> </div>
<div class="line"> <span class="comment">// append the literal to the rule body</span></div>
<div class="line"> <span class="keywordflow">if</span> (!<a name="a13"></a><a class="code" href="group__AST.html#ga5e34663385f03e1fdbd8674b4a3de619">clingo_ast_attribute_insert_ast_at</a>(stm, clingo_ast_attribute_body, size, lit)) {</div>
<div class="line"> <span class="keywordflow">goto</span> error;</div>
<div class="line"> }</div>
<div class="line"> </div>
<div class="line"> <span class="comment">// add the rewritten statement to the program</span></div>
<div class="line"> <span class="keywordflow">if</span> (!<a class="code" href="group__AST.html#gae269f530da9a010dbfd57b062c0d6758">clingo_program_builder_add</a>(data->builder, stm)) { <span class="keywordflow">goto</span> error; }</div>
<div class="line"> </div>
<div class="line"> <span class="keywordflow">goto</span> out;</div>
<div class="line"> </div>
<div class="line">error:</div>
<div class="line"> ret = <span class="keyword">false</span>;</div>
<div class="line"> </div>
<div class="line">out:</div>
<div class="line"> <span class="keywordflow">if</span> (lit != NULL) {</div>
<div class="line"> <a name="a14"></a><a class="code" href="group__AST.html#ga6eacefc169887432da243ba649a03689">clingo_ast_release</a>(lit);</div>
<div class="line"> }</div>
<div class="line"> <span class="keywordflow">return</span> ret;</div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">bool</span> solve(<a class="code" href="group__Control.html#gaf008e9db9dbb37b0b7ef039bb9d582f0">clingo_control_t</a> *ctl, <a class="code" href="group__Control.html#gae917a23b0591d181004ec88c4e3291c1">clingo_solve_result_bitset_t</a> *result) {</div>
<div class="line"> <span class="keywordtype">bool</span> ret = <span class="keyword">true</span>;</div>
<div class="line"> <a class="code" href="group__SolveHandle.html#ga023c1084a4c01ea6e121a8310efba045">clingo_solve_handle_t</a> *handle;</div>
<div class="line"> <a class="code" href="group__Model.html#gaaf9a93819f023f3cb8aa80598c46556b">clingo_model_t</a> <span class="keyword">const</span> *model;</div>
<div class="line"> </div>
<div class="line"> <span class="comment">// get a solve handle</span></div>
<div class="line"> <span class="keywordflow">if</span> (!<a name="a15"></a><a class="code" href="group__Control.html#ga4b3b7388e75ace676481f6021c4dc66d">clingo_control_solve</a>(ctl, <a name="a16"></a><a class="code" href="group__SolveHandle.html#gga63eb87834deebecdf9c799d64a3c65a2a60a9c133be636e68a7d02680c8b9d47e">clingo_solve_mode_yield</a>, NULL, 0, NULL, NULL, &handle)) { <span class="keywordflow">goto</span> error; }</div>
<div class="line"> <span class="comment">// loop over all models</span></div>
<div class="line"> <span class="keywordflow">while</span> (<span class="keyword">true</span>) {</div>
<div class="line"> <span class="keywordflow">if</span> (!<a name="a17"></a><a class="code" href="group__SolveHandle.html#ga73d71df7adeee92f1d515f52cdcbbac0">clingo_solve_handle_resume</a>(handle)) { <span class="keywordflow">goto</span> error; }</div>
<div class="line"> <span class="keywordflow">if</span> (!<a name="a18"></a><a class="code" href="group__SolveHandle.html#gaf9353c14149a2a16adf0474796871ae1">clingo_solve_handle_model</a>(handle, &model)) { <span class="keywordflow">goto</span> error; }</div>
<div class="line"> <span class="comment">// print the model</span></div>
<div class="line"> <span class="keywordflow">if</span> (model) { print_model(model); }</div>
<div class="line"> <span class="comment">// stop if there are no more models</span></div>
<div class="line"> <span class="keywordflow">else</span> { <span class="keywordflow">break</span>; }</div>
<div class="line"> }</div>
<div class="line"> <span class="comment">// close the solve handle</span></div>
<div class="line"> <span class="keywordflow">if</span> (!<a name="a19"></a><a class="code" href="group__SolveHandle.html#gae4270b7d4d0174a479307438680007c5">clingo_solve_handle_get</a>(handle, result)) { <span class="keywordflow">goto</span> error; }</div>
<div class="line"> </div>
<div class="line"> <span class="keywordflow">goto</span> out;</div>
<div class="line"> </div>
<div class="line">error:</div>
<div class="line"> ret = <span class="keyword">false</span>;</div>
<div class="line"> </div>
<div class="line">out:</div>
<div class="line"> <span class="comment">// free the solve handle</span></div>
<div class="line"> <span class="keywordflow">return</span> <a name="a20"></a><a class="code" href="group__SolveHandle.html#ga488b76e7240d625bd4066e68a33ab23e">clingo_solve_handle_close</a>(handle) && ret;</div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">int</span> main(<span class="keywordtype">int</span> argc, <span class="keywordtype">char</span> <span class="keyword">const</span> **argv) {</div>
<div class="line"> <span class="keywordtype">char</span> <span class="keyword">const</span> *error_message;</div>
<div class="line"> <span class="keywordtype">int</span> ret = 0;</div>
<div class="line"> <a class="code" href="group__Control.html#gae917a23b0591d181004ec88c4e3291c1">clingo_solve_result_bitset_t</a> solve_ret;</div>
<div class="line"> <a class="code" href="group__Control.html#gaf008e9db9dbb37b0b7ef039bb9d582f0">clingo_control_t</a> *ctl = NULL;</div>
<div class="line"> <a class="code" href="group__SymbolicAtoms.html#ga48f4026c13a49553efce213e76ab32aa">clingo_symbolic_atoms_t</a> <span class="keyword">const</span> *atoms = NULL;</div>
<div class="line"> <a class="code" href="group__SolveHandle.html#ga023c1084a4c01ea6e121a8310efba045">clingo_solve_handle_t</a> *handle = NULL;</div>
<div class="line"> <a class="code" href="group__Symbols.html#ga6c75c60fa57c3b97505265ff08f6f951">clingo_symbol_t</a> sym;</div>
<div class="line"> <a class="code" href="group__SymbolicAtoms.html#ga0a773e6f798cb2395d0cdfab5b277ca2">clingo_symbolic_atom_iterator_t</a> atm_it;</div>
<div class="line"> <a class="code" href="group__BasicTypes.html#gaa95dd19334e536397bbad174c8fa4ff8">clingo_literal_t</a> atm;</div>
<div class="line"> <a class="code" href="structclingo__location.html">clingo_location_t</a> location;</div>
<div class="line"> <a class="code" href="group__AST.html#ga18cb4e15ed8cfb0b70930fa6bc7accc5">clingo_ast_t</a> *term = NULL;</div>
<div class="line"> on_statement_data data = {NULL, NULL, NULL};</div>
<div class="line"> <a name="_a21"></a><a class="code" href="structclingo__part.html">clingo_part_t</a> parts[] = {{ <span class="stringliteral">"base"</span>, NULL, 0 }};</div>
<div class="line"> </div>
<div class="line"> <span class="comment">// create a control object and pass command line arguments</span></div>
<div class="line"> <span class="keywordflow">if</span> (!<a name="a22"></a><a class="code" href="group__Control.html#ga7ec38c676e45447bab71278b51e090c6">clingo_control_new</a>(argv+1, argc-1, NULL, NULL, 20, &ctl) != 0) { <span class="keywordflow">goto</span> error; }</div>
<div class="line"> </div>
<div class="line"> <span class="comment">// get the program builder</span></div>
<div class="line"> <span class="keywordflow">if</span> (!<a name="a23"></a><a class="code" href="group__AST.html#ga559ede7ac143b8de3a2d2b0e239d035e">clingo_program_builder_init</a>(ctl, &data.builder)) { <span class="keywordflow">goto</span> error; }</div>
<div class="line"> </div>
<div class="line"> <span class="comment">// initialize the location</span></div>
<div class="line"> location.<a name="a24"></a><a class="code" href="structclingo__location.html#a7e1cc6f6d6086bded33e3f9adbb16b90">begin_line</a> = location.<a name="a25"></a><a class="code" href="structclingo__location.html#a8fe7fd90b5eb6ae1885abc55ae40a6b0">end_line</a> = 0;</div>
<div class="line"> location.<a name="a26"></a><a class="code" href="structclingo__location.html#afe5db4636f00e6f9ee2bdb371591b4d6">begin_column</a> = location.<a name="a27"></a><a class="code" href="structclingo__location.html#a69787609f3a62fb6156c01f72bcddab2">end_column</a> = 0;</div>
<div class="line"> location.<a name="a28"></a><a class="code" href="structclingo__location.html#a181971c855b8bb40dcf7936fc228721a">begin_file</a> = location.<a name="a29"></a><a class="code" href="structclingo__location.html#a775547d5b6f6bec68e0942b020cbb6aa">end_file</a> = <span class="stringliteral">"<rewrite>"</span>;</div>
<div class="line"> data.loc = &location;</div>
<div class="line"> </div>
<div class="line"> <span class="comment">// initilize atom to add</span></div>
<div class="line"> <span class="keywordflow">if</span> (!<a name="a30"></a><a class="code" href="group__Symbols.html#ga5ee71976a0322a1f4bec4e283787b360">clingo_symbol_create_id</a>(<span class="stringliteral">"enable"</span>, <span class="keyword">true</span>, &sym)) { <span class="keywordflow">goto</span> error; }</div>
<div class="line"> </div>
<div class="line"> <span class="keywordflow">if</span> (!<a class="code" href="group__AST.html#ga01a0ea8ed6ef60f53a577dad572a4647">clingo_ast_build</a>(clingo_ast_type_symbolic_term, &term, data.loc, sym)) {</div>
<div class="line"> <span class="keywordflow">goto</span> error;</div>
<div class="line"> }</div>
<div class="line"> <span class="keywordflow">if</span> (!<a class="code" href="group__AST.html#ga01a0ea8ed6ef60f53a577dad572a4647">clingo_ast_build</a>(clingo_ast_type_symbolic_atom, &data.atom, term)) {</div>
<div class="line"> <span class="keywordflow">goto</span> error;</div>
<div class="line"> }</div>
<div class="line"> </div>
<div class="line"> <span class="comment">// begin building a program</span></div>
<div class="line"> <span class="keywordflow">if</span> (!<a name="a31"></a><a class="code" href="group__AST.html#ga24041cf092eeda6aeb67ce496a5bb3d5">clingo_program_builder_begin</a>(data.builder)) { <span class="keywordflow">goto</span> error; }</div>
<div class="line"> </div>
<div class="line"> <span class="comment">// get the AST of the program</span></div>
<div class="line"> <span class="keywordflow">if</span> (!<a name="a32"></a><a class="code" href="group__AST.html#gaa88e4e48abb5451f0871373c8f59c553">clingo_ast_parse_string</a>(<span class="stringliteral">"a :- not b. b :- not a."</span>, (<a name="a33"></a><a class="code" href="group__AST.html#gac1a650b859ab19fef4c438c02dbf55b6">clingo_ast_callback_t</a>)on_statement, &data, NULL, NULL, NULL, 20)) { <span class="keywordflow">goto</span> error; }</div>
<div class="line"> </div>
<div class="line"> <span class="comment">// finish building a program</span></div>
<div class="line"> <span class="keywordflow">if</span> (!<a name="a34"></a><a class="code" href="group__AST.html#ga82198c84afe8f9bb754ebbc4c6c78a25">clingo_program_builder_end</a>(data.builder)) { <span class="keywordflow">goto</span> error; }</div>
<div class="line"> </div>
<div class="line"> <span class="comment">// add the external statement: #external enable.</span></div>
<div class="line"> <span class="keywordflow">if</span> (!<a name="a35"></a><a class="code" href="group__Control.html#gada7b7f54331abfedf60fac33d742c0dc">clingo_control_add</a>(ctl, <span class="stringliteral">"base"</span>, NULL, 0, <span class="stringliteral">"#external enable."</span>)) {</div>
<div class="line"> <span class="keywordflow">goto</span> error;</div>
<div class="line"> }</div>
<div class="line"> </div>
<div class="line"> <span class="comment">// ground the base part</span></div>
<div class="line"> <span class="keywordflow">if</span> (!<a name="a36"></a><a class="code" href="group__Control.html#gaf85b77055668171e6a85f9d729719b57">clingo_control_ground</a>(ctl, parts, 1, NULL, NULL)) { <span class="keywordflow">goto</span> error; }</div>
<div class="line"> </div>
<div class="line"> <span class="comment">// get the program literal coresponding to the external atom</span></div>
<div class="line"> <span class="keywordflow">if</span> (!<a name="a37"></a><a class="code" href="group__Control.html#ga2686c7f31210320fbb6a3c94a6efaaf2">clingo_control_symbolic_atoms</a>(ctl, &atoms)) { <span class="keywordflow">goto</span> error; }</div>
<div class="line"> <span class="keywordflow">if</span> (!<a name="a38"></a><a class="code" href="group__SymbolicAtoms.html#gac6d3fdfc082a255a4bdcdb18a9cea1f7">clingo_symbolic_atoms_find</a>(atoms, sym, &atm_it)) { <span class="keywordflow">goto</span> error; }</div>
<div class="line"> <span class="keywordflow">if</span> (!<a name="a39"></a><a class="code" href="group__SymbolicAtoms.html#ga4a16d4ccabc8246f8d1f3a4660cc1aff">clingo_symbolic_atoms_literal</a>(atoms, atm_it, &atm)) { <span class="keywordflow">goto</span> error; }</div>
<div class="line"> </div>
<div class="line"> <span class="comment">// solve with external enable = false</span></div>
<div class="line"> printf(<span class="stringliteral">"Solving with enable = false...\n"</span>);</div>
<div class="line"> <span class="keywordflow">if</span> (!solve(ctl, &solve_ret)) { <span class="keywordflow">goto</span> error; }</div>
<div class="line"> <span class="comment">// solve with external enable = true</span></div>
<div class="line"> printf(<span class="stringliteral">"Solving with enable = true...\n"</span>);</div>
<div class="line"> <span class="keywordflow">if</span> (!<a name="a40"></a><a class="code" href="group__Control.html#ga27f0fe2e063f6a5bda363bde93cf73b9">clingo_control_assign_external</a>(ctl, atm, <a name="a41"></a><a class="code" href="group__BasicTypes.html#ggac6094190b006063cdb8ea4d5d2ca685da304e39ab32ecb495a7a13626a3125276">clingo_truth_value_true</a>)) { <span class="keywordflow">goto</span> error; }</div>
<div class="line"> <span class="keywordflow">if</span> (!solve(ctl, &solve_ret)) { <span class="keywordflow">goto</span> error; }</div>
<div class="line"> <span class="comment">// solve with external enable = false</span></div>
<div class="line"> printf(<span class="stringliteral">"Solving with enable = false...\n"</span>);</div>
<div class="line"> <span class="keywordflow">if</span> (!<a class="code" href="group__Control.html#ga27f0fe2e063f6a5bda363bde93cf73b9">clingo_control_assign_external</a>(ctl, atm, <a name="a42"></a><a class="code" href="group__BasicTypes.html#ggac6094190b006063cdb8ea4d5d2ca685da2ac4886c8ca9dfd7f0d70cd24e07cf52">clingo_truth_value_false</a>)) { <span class="keywordflow">goto</span> error; }</div>
<div class="line"> <span class="keywordflow">if</span> (!solve(ctl, &solve_ret)) { <span class="keywordflow">goto</span> error; }</div>
<div class="line"> </div>
<div class="line"> <span class="keywordflow">goto</span> out;</div>
<div class="line"> </div>
<div class="line">error:</div>
<div class="line"> <span class="keywordflow">if</span> (!(error_message = <a name="a43"></a><a class="code" href="group__BasicTypes.html#ga8bc3d9c18f15023bef4f427e5bf69c9f">clingo_error_message</a>())) { error_message = <span class="stringliteral">"error"</span>; }</div>
<div class="line"> </div>
<div class="line"> printf(<span class="stringliteral">"%s\n"</span>, error_message);</div>
<div class="line"> ret = <a name="a44"></a><a class="code" href="group__BasicTypes.html#gab6fae458db566efb7d6684ffda376aa8">clingo_error_code</a>();</div>
<div class="line"> </div>
<div class="line">out:</div>
<div class="line"> <span class="keywordflow">if</span> (term) { <a class="code" href="group__AST.html#ga6eacefc169887432da243ba649a03689">clingo_ast_release</a>(term); }</div>
<div class="line"> <span class="keywordflow">if</span> (data.atom) { <a class="code" href="group__AST.html#ga6eacefc169887432da243ba649a03689">clingo_ast_release</a>(data.atom); }</div>
<div class="line"> <span class="keywordflow">if</span> (handle) { <a class="code" href="group__SolveHandle.html#ga488b76e7240d625bd4066e68a33ab23e">clingo_solve_handle_close</a>(handle); }</div>
<div class="line"> <span class="keywordflow">if</span> (ctl) { <a name="a45"></a><a class="code" href="group__Control.html#ga849604bd7107e6948a0e08e1dc10178a">clingo_control_free</a>(ctl); }</div>
<div class="line"> </div>
<div class="line"> <span class="keywordflow">return</span> ret;</div>
<div class="line">}</div>
</div><!-- fragment --> </div><!-- contents -->
<div class="ttc" id="agroup__BasicTypes_html_ggac6094190b006063cdb8ea4d5d2ca685da304e39ab32ecb495a7a13626a3125276"><div class="ttname"><a href="group__BasicTypes.html#ggac6094190b006063cdb8ea4d5d2ca685da304e39ab32ecb495a7a13626a3125276">clingo_truth_value_true</a></div><div class="ttdeci">@ clingo_truth_value_true</div><div class="ttdoc">true</div><div class="ttdef"><b>Definition:</b> clingo.h:200</div></div>
<div class="ttc" id="agroup__AST_html_ga18cb4e15ed8cfb0b70930fa6bc7accc5"><div class="ttname"><a href="group__AST.html#ga18cb4e15ed8cfb0b70930fa6bc7accc5">clingo_ast_t</a></div><div class="ttdeci">struct clingo_ast clingo_ast_t</div><div class="ttdoc">This struct provides a view to nodes in the AST.</div><div class="ttdef"><b>Definition:</b> clingo.h:3287</div></div>
<div class="ttc" id="astructclingo__location_html_a8fe7fd90b5eb6ae1885abc55ae40a6b0"><div class="ttname"><a href="structclingo__location.html#a8fe7fd90b5eb6ae1885abc55ae40a6b0">clingo_location::end_line</a></div><div class="ttdeci">size_t end_line</div><div class="ttdoc">the line where the location ends</div><div class="ttdef"><b>Definition:</b> clingo.h:215</div></div>
<div class="ttc" id="agroup__SolveHandle_html_gga63eb87834deebecdf9c799d64a3c65a2a60a9c133be636e68a7d02680c8b9d47e"><div class="ttname"><a href="group__SolveHandle.html#gga63eb87834deebecdf9c799d64a3c65a2a60a9c133be636e68a7d02680c8b9d47e">clingo_solve_mode_yield</a></div><div class="ttdeci">@ clingo_solve_mode_yield</div><div class="ttdoc">Yield models in calls to clingo_solve_handle_model.</div><div class="ttdef"><b>Definition:</b> clingo.h:2288</div></div>
<div class="ttc" id="agroup__Model_html_gga72e8ba23a84af09dfd93739ebaa6ecf8a82a698ef41cd919cb370d22fc0b44826"><div class="ttname"><a href="group__Model.html#gga72e8ba23a84af09dfd93739ebaa6ecf8a82a698ef41cd919cb370d22fc0b44826">clingo_show_type_shown</a></div><div class="ttdeci">@ clingo_show_type_shown</div><div class="ttdoc">Select shown atoms and terms.</div><div class="ttdef"><b>Definition:</b> clingo.h:2098</div></div>
<div class="ttc" id="agroup__Control_html_gaf008e9db9dbb37b0b7ef039bb9d582f0"><div class="ttname"><a href="group__Control.html#gaf008e9db9dbb37b0b7ef039bb9d582f0">clingo_control_t</a></div><div class="ttdeci">struct clingo_control clingo_control_t</div><div class="ttdoc">Control object holding grounding and solving state.</div><div class="ttdef"><b>Definition:</b> clingo.h:2693</div></div>
<div class="ttc" id="agroup__Control_html_ga7ec38c676e45447bab71278b51e090c6"><div class="ttname"><a href="group__Control.html#ga7ec38c676e45447bab71278b51e090c6">clingo_control_new</a></div><div class="ttdeci">CLINGO_VISIBILITY_DEFAULT bool clingo_control_new(char const *const *arguments, size_t arguments_size, clingo_logger_t logger, void *logger_data, unsigned message_limit, clingo_control_t **control)</div><div class="ttdoc">Create a new control object.</div></div>
<div class="ttc" id="astructclingo__location_html_a7e1cc6f6d6086bded33e3f9adbb16b90"><div class="ttname"><a href="structclingo__location.html#a7e1cc6f6d6086bded33e3f9adbb16b90">clingo_location::begin_line</a></div><div class="ttdeci">size_t begin_line</div><div class="ttdoc">the line where the location begins</div><div class="ttdef"><b>Definition:</b> clingo.h:214</div></div>
<div class="ttc" id="agroup__SymbolicAtoms_html_ga4a16d4ccabc8246f8d1f3a4660cc1aff"><div class="ttname"><a href="group__SymbolicAtoms.html#ga4a16d4ccabc8246f8d1f3a4660cc1aff">clingo_symbolic_atoms_literal</a></div><div class="ttdeci">CLINGO_VISIBILITY_DEFAULT bool clingo_symbolic_atoms_literal(clingo_symbolic_atoms_t const *atoms, clingo_symbolic_atom_iterator_t iterator, clingo_literal_t *literal)</div><div class="ttdoc">Returns the (numeric) aspif literal corresponding to the given symbolic atom.</div></div>
<div class="ttc" id="agroup__AST_html_ga8a95127916235f7316274c107dfb688f"><div class="ttname"><a href="group__AST.html#ga8a95127916235f7316274c107dfb688f">clingo_ast_get_type</a></div><div class="ttdeci">CLINGO_VISIBILITY_DEFAULT bool clingo_ast_get_type(clingo_ast_t *ast, clingo_ast_type_t *type)</div><div class="ttdoc">Get the type of an AST node.</div></div>
<div class="ttc" id="agroup__AST_html_ga1fe74e0e6ea76c81af7928ad4e1d6f64"><div class="ttname"><a href="group__AST.html#ga1fe74e0e6ea76c81af7928ad4e1d6f64">clingo_ast_type_t</a></div><div class="ttdeci">int clingo_ast_type_t</div><div class="ttdoc">Corresponding type to clingo_ast_type_e.</div><div class="ttdef"><b>Definition:</b> clingo.h:3187</div></div>
<div class="ttc" id="agroup__Control_html_ga2686c7f31210320fbb6a3c94a6efaaf2"><div class="ttname"><a href="group__Control.html#ga2686c7f31210320fbb6a3c94a6efaaf2">clingo_control_symbolic_atoms</a></div><div class="ttdeci">CLINGO_VISIBILITY_DEFAULT bool clingo_control_symbolic_atoms(clingo_control_t const *control, clingo_symbolic_atoms_t const **atoms)</div><div class="ttdoc">Get an object to inspect symbolic atoms (the relevant Herbrand base) used for grounding.</div></div>
<div class="ttc" id="astructclingo__location_html_a181971c855b8bb40dcf7936fc228721a"><div class="ttname"><a href="structclingo__location.html#a181971c855b8bb40dcf7936fc228721a">clingo_location::begin_file</a></div><div class="ttdeci">const char * begin_file</div><div class="ttdoc">the file where the location begins</div><div class="ttdef"><b>Definition:</b> clingo.h:212</div></div>
<div class="ttc" id="agroup__Control_html_ga849604bd7107e6948a0e08e1dc10178a"><div class="ttname"><a href="group__Control.html#ga849604bd7107e6948a0e08e1dc10178a">clingo_control_free</a></div><div class="ttdeci">CLINGO_VISIBILITY_DEFAULT void clingo_control_free(clingo_control_t *control)</div><div class="ttdoc">Free a control object created with clingo_control_new().</div></div>
<div class="ttc" id="agroup__SymbolicAtoms_html_ga48f4026c13a49553efce213e76ab32aa"><div class="ttname"><a href="group__SymbolicAtoms.html#ga48f4026c13a49553efce213e76ab32aa">clingo_symbolic_atoms_t</a></div><div class="ttdeci">struct clingo_symbolic_atoms clingo_symbolic_atoms_t</div><div class="ttdoc">Object to inspect symbolic atoms in a program—the relevant Herbrand base gringo uses to instantiate p...</div><div class="ttdef"><b>Definition:</b> clingo.h:542</div></div>
<div class="ttc" id="agroup__AST_html_gaa88e4e48abb5451f0871373c8f59c553"><div class="ttname"><a href="group__AST.html#gaa88e4e48abb5451f0871373c8f59c553">clingo_ast_parse_string</a></div><div class="ttdeci">CLINGO_VISIBILITY_DEFAULT bool clingo_ast_parse_string(char const *program, clingo_ast_callback_t callback, void *callback_data, clingo_control_t *control, clingo_logger_t logger, void *logger_data, unsigned message_limit)</div><div class="ttdoc">Parse the given program and return an abstract syntax tree for each statement via a callback.</div></div>
<div class="ttc" id="agroup__BasicTypes_html_gaa95dd19334e536397bbad174c8fa4ff8"><div class="ttname"><a href="group__BasicTypes.html#gaa95dd19334e536397bbad174c8fa4ff8">clingo_literal_t</a></div><div class="ttdeci">int32_t clingo_literal_t</div><div class="ttdoc">Signed integer type used for aspif and solver literals.</div><div class="ttdef"><b>Definition:</b> clingo.h:121</div></div>
<div class="ttc" id="aclingo_8h_html"><div class="ttname"><a href="clingo_8h.html">clingo.h</a></div></div>
<div class="ttc" id="agroup__AST_html_ga6eacefc169887432da243ba649a03689"><div class="ttname"><a href="group__AST.html#ga6eacefc169887432da243ba649a03689">clingo_ast_release</a></div><div class="ttdeci">CLINGO_VISIBILITY_DEFAULT void clingo_ast_release(clingo_ast_t *ast)</div><div class="ttdoc">Decrement the reference count of an AST node.</div></div>
<div class="ttc" id="astructclingo__part_html"><div class="ttname"><a href="structclingo__part.html">clingo_part</a></div><div class="ttdoc">Struct used to specify the program parts that have to be grounded.</div><div class="ttdef"><b>Definition:</b> clingo.h:2645</div></div>
<div class="ttc" id="agroup__AST_html_ga82198c84afe8f9bb754ebbc4c6c78a25"><div class="ttname"><a href="group__AST.html#ga82198c84afe8f9bb754ebbc4c6c78a25">clingo_program_builder_end</a></div><div class="ttdeci">CLINGO_VISIBILITY_DEFAULT bool clingo_program_builder_end(clingo_program_builder_t *builder)</div><div class="ttdoc">End building a program.</div></div>
<div class="ttc" id="agroup__SolveHandle_html_ga488b76e7240d625bd4066e68a33ab23e"><div class="ttname"><a href="group__SolveHandle.html#ga488b76e7240d625bd4066e68a33ab23e">clingo_solve_handle_close</a></div><div class="ttdeci">CLINGO_VISIBILITY_DEFAULT bool clingo_solve_handle_close(clingo_solve_handle_t *handle)</div><div class="ttdoc">Stops the running search and releases the handle.</div></div>
<div class="ttc" id="agroup__Symbols_html_gac292526ba129269eec3c64510deec3b0"><div class="ttname"><a href="group__Symbols.html#gac292526ba129269eec3c64510deec3b0">clingo_symbol_to_string</a></div><div class="ttdeci">CLINGO_VISIBILITY_DEFAULT bool clingo_symbol_to_string(clingo_symbol_t symbol, char *string, size_t size)</div><div class="ttdoc">Get the string representation of a symbol.</div></div>
<div class="ttc" id="agroup__Symbols_html_ga5ee71976a0322a1f4bec4e283787b360"><div class="ttname"><a href="group__Symbols.html#ga5ee71976a0322a1f4bec4e283787b360">clingo_symbol_create_id</a></div><div class="ttdeci">CLINGO_VISIBILITY_DEFAULT bool clingo_symbol_create_id(char const *name, bool positive, clingo_symbol_t *symbol)</div><div class="ttdoc">Construct a symbol representing an id.</div></div>
<div class="ttc" id="agroup__Control_html_gaf85b77055668171e6a85f9d729719b57"><div class="ttname"><a href="group__Control.html#gaf85b77055668171e6a85f9d729719b57">clingo_control_ground</a></div><div class="ttdeci">CLINGO_VISIBILITY_DEFAULT bool clingo_control_ground(clingo_control_t *control, clingo_part_t const *parts, size_t parts_size, clingo_ground_callback_t ground_callback, void *ground_callback_data)</div><div class="ttdoc">Ground the selected parts of the current (non-ground) logic program.</div></div>
<div class="ttc" id="agroup__Control_html_gada7b7f54331abfedf60fac33d742c0dc"><div class="ttname"><a href="group__Control.html#gada7b7f54331abfedf60fac33d742c0dc">clingo_control_add</a></div><div class="ttdeci">CLINGO_VISIBILITY_DEFAULT bool clingo_control_add(clingo_control_t *control, char const *name, char const *const *parameters, size_t parameters_size, char const *program)</div><div class="ttdoc">Extend the logic program with the given non-ground logic program in string form.</div></div>
<div class="ttc" id="agroup__SolveHandle_html_gae4270b7d4d0174a479307438680007c5"><div class="ttname"><a href="group__SolveHandle.html#gae4270b7d4d0174a479307438680007c5">clingo_solve_handle_get</a></div><div class="ttdeci">CLINGO_VISIBILITY_DEFAULT bool clingo_solve_handle_get(clingo_solve_handle_t *handle, clingo_solve_result_bitset_t *result)</div><div class="ttdoc">Get the next solve result.</div></div>
<div class="ttc" id="agroup__AST_html_gacc311f05451081ce654b65610bdf2fd6"><div class="ttname"><a href="group__AST.html#gacc311f05451081ce654b65610bdf2fd6">clingo_ast_attribute_size_ast_array</a></div><div class="ttdeci">CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_size_ast_array(clingo_ast_t *ast, clingo_ast_attribute_t attribute, size_t *size)</div><div class="ttdoc">Get the size of an attribute of type "clingo_ast_attribute_type_ast_array".</div></div>
<div class="ttc" id="agroup__Control_html_ga4b3b7388e75ace676481f6021c4dc66d"><div class="ttname"><a href="group__Control.html#ga4b3b7388e75ace676481f6021c4dc66d">clingo_control_solve</a></div><div class="ttdeci">CLINGO_VISIBILITY_DEFAULT bool clingo_control_solve(clingo_control_t *control, clingo_solve_mode_bitset_t mode, clingo_literal_t const *assumptions, size_t assumptions_size, clingo_solve_event_callback_t notify, void *data, clingo_solve_handle_t **handle)</div><div class="ttdoc">Solve the currently grounded logic program enumerating its models.</div></div>
<div class="ttc" id="agroup__Control_html_ga27f0fe2e063f6a5bda363bde93cf73b9"><div class="ttname"><a href="group__Control.html#ga27f0fe2e063f6a5bda363bde93cf73b9">clingo_control_assign_external</a></div><div class="ttdeci">CLINGO_VISIBILITY_DEFAULT bool clingo_control_assign_external(clingo_control_t *control, clingo_literal_t literal, clingo_truth_value_t value)</div><div class="ttdoc">Assign a truth value to an external atom.</div></div>
<div class="ttc" id="agroup__Model_html_gaaf9a93819f023f3cb8aa80598c46556b"><div class="ttname"><a href="group__Model.html#gaaf9a93819f023f3cb8aa80598c46556b">clingo_model_t</a></div><div class="ttdeci">struct clingo_model clingo_model_t</div><div class="ttdoc">Object representing a model.</div><div class="ttdef"><b>Definition:</b> clingo.h:2085</div></div>
<div class="ttc" id="agroup__SolveHandle_html_ga73d71df7adeee92f1d515f52cdcbbac0"><div class="ttname"><a href="group__SolveHandle.html#ga73d71df7adeee92f1d515f52cdcbbac0">clingo_solve_handle_resume</a></div><div class="ttdeci">CLINGO_VISIBILITY_DEFAULT bool clingo_solve_handle_resume(clingo_solve_handle_t *handle)</div><div class="ttdoc">Discards the last model and starts the search for the next one.</div></div>
<div class="ttc" id="agroup__AST_html_ga01a0ea8ed6ef60f53a577dad572a4647"><div class="ttname"><a href="group__AST.html#ga01a0ea8ed6ef60f53a577dad572a4647">clingo_ast_build</a></div><div class="ttdeci">CLINGO_VISIBILITY_DEFAULT bool clingo_ast_build(clingo_ast_type_t type, clingo_ast_t **ast,...)</div><div class="ttdoc">Construct an AST of the given type.</div></div>
<div class="ttc" id="agroup__AST_html_gae269f530da9a010dbfd57b062c0d6758"><div class="ttname"><a href="group__AST.html#gae269f530da9a010dbfd57b062c0d6758">clingo_program_builder_add</a></div><div class="ttdeci">CLINGO_VISIBILITY_DEFAULT bool clingo_program_builder_add(clingo_program_builder_t *builder, clingo_ast_t *ast)</div><div class="ttdoc">Adds a statement to the program.</div></div>
<div class="ttc" id="agroup__BasicTypes_html_ggac6094190b006063cdb8ea4d5d2ca685da2ac4886c8ca9dfd7f0d70cd24e07cf52"><div class="ttname"><a href="group__BasicTypes.html#ggac6094190b006063cdb8ea4d5d2ca685da2ac4886c8ca9dfd7f0d70cd24e07cf52">clingo_truth_value_false</a></div><div class="ttdeci">@ clingo_truth_value_false</div><div class="ttdoc">false</div><div class="ttdef"><b>Definition:</b> clingo.h:201</div></div>
<div class="ttc" id="agroup__Symbols_html_ga6963e11f6d22a5c04a0e50d1afe1f4f5"><div class="ttname"><a href="group__Symbols.html#ga6963e11f6d22a5c04a0e50d1afe1f4f5">clingo_symbol_to_string_size</a></div><div class="ttdeci">CLINGO_VISIBILITY_DEFAULT bool clingo_symbol_to_string_size(clingo_symbol_t symbol, size_t *size)</div><div class="ttdoc">Get the size of the string representation of a symbol (including the terminating 0).</div></div>
<div class="ttc" id="agroup__Model_html_ga5c6c30cef0e3a29a192577a1a739ca69"><div class="ttname"><a href="group__Model.html#ga5c6c30cef0e3a29a192577a1a739ca69">clingo_model_symbols_size</a></div><div class="ttdeci">CLINGO_VISIBILITY_DEFAULT bool clingo_model_symbols_size(clingo_model_t const *model, clingo_show_type_bitset_t show, size_t *size)</div><div class="ttdoc">Get the number of symbols of the selected types in the model.</div></div>
<div class="ttc" id="agroup__AST_html_ga559ede7ac143b8de3a2d2b0e239d035e"><div class="ttname"><a href="group__AST.html#ga559ede7ac143b8de3a2d2b0e239d035e">clingo_program_builder_init</a></div><div class="ttdeci">CLINGO_VISIBILITY_DEFAULT bool clingo_program_builder_init(clingo_control_t *control, clingo_program_builder_t **builder)</div><div class="ttdoc">Get an object to add non-ground directives to the program.</div></div>
<div class="ttc" id="agroup__AST_html_gaf3ea2b021e93cdcc0f6c7b4219e4a06d"><div class="ttname"><a href="group__AST.html#gaf3ea2b021e93cdcc0f6c7b4219e4a06d">clingo_program_builder_t</a></div><div class="ttdeci">struct clingo_program_builder clingo_program_builder_t</div><div class="ttdoc">Object to build non-ground programs.</div><div class="ttdef"><b>Definition:</b> clingo.h:3702</div></div>
<div class="ttc" id="agroup__SolveHandle_html_ga023c1084a4c01ea6e121a8310efba045"><div class="ttname"><a href="group__SolveHandle.html#ga023c1084a4c01ea6e121a8310efba045">clingo_solve_handle_t</a></div><div class="ttdeci">struct clingo_solve_handle clingo_solve_handle_t</div><div class="ttdoc">Search handle to a solve call.</div><div class="ttdef"><b>Definition:</b> clingo.h:2322</div></div>
<div class="ttc" id="agroup__Control_html_gae917a23b0591d181004ec88c4e3291c1"><div class="ttname"><a href="group__Control.html#gae917a23b0591d181004ec88c4e3291c1">clingo_solve_result_bitset_t</a></div><div class="ttdeci">unsigned clingo_solve_result_bitset_t</div><div class="ttdef"><b>Definition:</b> clingo.h:2248</div></div>
<div class="ttc" id="agroup__SolveHandle_html_gaf9353c14149a2a16adf0474796871ae1"><div class="ttname"><a href="group__SolveHandle.html#gaf9353c14149a2a16adf0474796871ae1">clingo_solve_handle_model</a></div><div class="ttdeci">CLINGO_VISIBILITY_DEFAULT bool clingo_solve_handle_model(clingo_solve_handle_t *handle, clingo_model_t const **model)</div><div class="ttdoc">Get the next model (or zero if there are no more models).</div></div>
<div class="ttc" id="astructclingo__location_html_a69787609f3a62fb6156c01f72bcddab2"><div class="ttname"><a href="structclingo__location.html#a69787609f3a62fb6156c01f72bcddab2">clingo_location::end_column</a></div><div class="ttdeci">size_t end_column</div><div class="ttdoc">the column where the location ends</div><div class="ttdef"><b>Definition:</b> clingo.h:217</div></div>
<div class="ttc" id="agroup__BasicTypes_html_gab6fae458db566efb7d6684ffda376aa8"><div class="ttname"><a href="group__BasicTypes.html#gab6fae458db566efb7d6684ffda376aa8">clingo_error_code</a></div><div class="ttdeci">CLINGO_VISIBILITY_DEFAULT clingo_error_t clingo_error_code()</div><div class="ttdoc">Get the last error code set by a clingo API call.</div></div>
<div class="ttc" id="agroup__BasicTypes_html_ga8bc3d9c18f15023bef4f427e5bf69c9f"><div class="ttname"><a href="group__BasicTypes.html#ga8bc3d9c18f15023bef4f427e5bf69c9f">clingo_error_message</a></div><div class="ttdeci">CLINGO_VISIBILITY_DEFAULT const char * clingo_error_message()</div><div class="ttdoc">Get the last error message set if an API call fails.</div></div>
<div class="ttc" id="agroup__AST_html_ga24041cf092eeda6aeb67ce496a5bb3d5"><div class="ttname"><a href="group__AST.html#ga24041cf092eeda6aeb67ce496a5bb3d5">clingo_program_builder_begin</a></div><div class="ttdeci">CLINGO_VISIBILITY_DEFAULT bool clingo_program_builder_begin(clingo_program_builder_t *builder)</div><div class="ttdoc">Begin building a program.</div></div>
<div class="ttc" id="agroup__AST_html_gga6e364e06578fa662c56ded83b6bf14d6a181102f5331f8352f4f603f81010269d"><div class="ttname"><a href="group__AST.html#gga6e364e06578fa662c56ded83b6bf14d6a181102f5331f8352f4f603f81010269d">clingo_ast_sign_no_sign</a></div><div class="ttdeci">@ clingo_ast_sign_no_sign</div><div class="ttdoc">For positive literals.</div><div class="ttdef"><b>Definition:</b> clingo.h:3070</div></div>
<div class="ttc" id="astructclingo__location_html_a775547d5b6f6bec68e0942b020cbb6aa"><div class="ttname"><a href="structclingo__location.html#a775547d5b6f6bec68e0942b020cbb6aa">clingo_location::end_file</a></div><div class="ttdeci">const char * end_file</div><div class="ttdoc">the file where the location ends</div><div class="ttdef"><b>Definition:</b> clingo.h:213</div></div>
<div class="ttc" id="agroup__Symbols_html_ga6c75c60fa57c3b97505265ff08f6f951"><div class="ttname"><a href="group__Symbols.html#ga6c75c60fa57c3b97505265ff08f6f951">clingo_symbol_t</a></div><div class="ttdeci">uint64_t clingo_symbol_t</div><div class="ttdoc">Represents a symbol.</div><div class="ttdef"><b>Definition:</b> clingo.h:330</div></div>
<div class="ttc" id="astructclingo__location_html"><div class="ttname"><a href="structclingo__location.html">clingo_location</a></div><div class="ttdoc">Represents a source code location marking its beginnig and end.</div><div class="ttdef"><b>Definition:</b> clingo.h:211</div></div>
<div class="ttc" id="agroup__SymbolicAtoms_html_ga0a773e6f798cb2395d0cdfab5b277ca2"><div class="ttname"><a href="group__SymbolicAtoms.html#ga0a773e6f798cb2395d0cdfab5b277ca2">clingo_symbolic_atom_iterator_t</a></div><div class="ttdeci">uint64_t clingo_symbolic_atom_iterator_t</div><div class="ttdoc">Object to iterate over symbolic atoms.</div><div class="ttdef"><b>Definition:</b> clingo.h:552</div></div>
<div class="ttc" id="agroup__BasicTypes_html_ggaebdf91a4187db9abdd2c6ceb971cf13eaa14a0926eb3e653fcc13299b33d8d348"><div class="ttname"><a href="group__BasicTypes.html#ggaebdf91a4187db9abdd2c6ceb971cf13eaa14a0926eb3e653fcc13299b33d8d348">clingo_error_bad_alloc</a></div><div class="ttdeci">@ clingo_error_bad_alloc</div><div class="ttdoc">memory could not be allocated</div><div class="ttdef"><b>Definition:</b> clingo.h:145</div></div>
<div class="ttc" id="agroup__SymbolicAtoms_html_gac6d3fdfc082a255a4bdcdb18a9cea1f7"><div class="ttname"><a href="group__SymbolicAtoms.html#gac6d3fdfc082a255a4bdcdb18a9cea1f7">clingo_symbolic_atoms_find</a></div><div class="ttdeci">CLINGO_VISIBILITY_DEFAULT bool clingo_symbolic_atoms_find(clingo_symbolic_atoms_t const *atoms, clingo_symbol_t symbol, clingo_symbolic_atom_iterator_t *iterator)</div><div class="ttdoc">Find a symbolic atom given its symbolic representation.</div></div>
<div class="ttc" id="astructclingo__location_html_afe5db4636f00e6f9ee2bdb371591b4d6"><div class="ttname"><a href="structclingo__location.html#afe5db4636f00e6f9ee2bdb371591b4d6">clingo_location::begin_column</a></div><div class="ttdeci">size_t begin_column</div><div class="ttdoc">the column where the location begins</div><div class="ttdef"><b>Definition:</b> clingo.h:216</div></div>
<div class="ttc" id="agroup__AST_html_gac1a650b859ab19fef4c438c02dbf55b6"><div class="ttname"><a href="group__AST.html#gac1a650b859ab19fef4c438c02dbf55b6">clingo_ast_callback_t</a></div><div class="ttdeci">bool(* clingo_ast_callback_t)(clingo_ast_t *ast, void *data)</div><div class="ttdoc">Callback function to intercept AST nodes.</div><div class="ttdef"><b>Definition:</b> clingo.h:3663</div></div>
<div class="ttc" id="agroup__BasicTypes_html_ga5c2b2943475239e151eb783d30548b38"><div class="ttname"><a href="group__BasicTypes.html#ga5c2b2943475239e151eb783d30548b38">clingo_set_error</a></div><div class="ttdeci">CLINGO_VISIBILITY_DEFAULT void clingo_set_error(clingo_error_t code, char const *message)</div><div class="ttdoc">Set a custom error code and message in the active thread.</div></div>
<div class="ttc" id="agroup__Model_html_ga05d849166d689a3d4ae8d40fba070d91"><div class="ttname"><a href="group__Model.html#ga05d849166d689a3d4ae8d40fba070d91">clingo_model_symbols</a></div><div class="ttdeci">CLINGO_VISIBILITY_DEFAULT bool clingo_model_symbols(clingo_model_t const *model, clingo_show_type_bitset_t show, clingo_symbol_t *symbols, size_t size)</div><div class="ttdoc">Get the symbols of the selected types in the model.</div></div>
<div class="ttc" id="agroup__AST_html_ga5e34663385f03e1fdbd8674b4a3de619"><div class="ttname"><a href="group__AST.html#ga5e34663385f03e1fdbd8674b4a3de619">clingo_ast_attribute_insert_ast_at</a></div><div class="ttdeci">CLINGO_VISIBILITY_DEFAULT bool clingo_ast_attribute_insert_ast_at(clingo_ast_t *ast, clingo_ast_attribute_t attribute, size_t index, clingo_ast_t *value)</div><div class="ttdoc">Insert a value into an attribute of type "clingo_ast_attribute_type_ast_array" at the given index.</div></div>
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Fri Sep 16 2022 19:52:36 for Clingo C API by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.17
</small></address>
</body>
</html>