-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathgroup__SolveHandle.html
522 lines (487 loc) · 36.2 KB
/
group__SolveHandle.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
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
<!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: Solving</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="summary">
<a href="#typedef-members">Typedefs</a> |
<a href="#enum-members">Enumerations</a> |
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">Solving<div class="ingroups"><a class="el" href="group__Control.html">Grounding and Solving</a></div></div> </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>Interact with a running search. </p>
<p>A <a class="el" href="group__SolveHandle.html#ga023c1084a4c01ea6e121a8310efba045" title="Search handle to a solve call.">clingo_solve_handle_t</a> objects can be used for both synchronous and asynchronous search, as well as iteratively receiving models and solve results.</p>
<p>For an example showing how to solve asynchronously, see <a class="el" href="solve-async_8c-example.html">solve-async.c</a>. </p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:gad429252492888205c9de9a295a724496"><td class="memItemLeft" align="right" valign="top"><a id="gad429252492888205c9de9a295a724496"></a>
typedef unsigned </td><td class="memItemRight" valign="bottom"><a class="el" href="group__SolveHandle.html#gad429252492888205c9de9a295a724496">clingo_solve_mode_bitset_t</a></td></tr>
<tr class="memdesc:gad429252492888205c9de9a295a724496"><td class="mdescLeft"> </td><td class="mdescRight">Corresponding type to <a class="el" href="group__SolveHandle.html#ga63eb87834deebecdf9c799d64a3c65a2" title="Enumeration of solve modes.">clingo_solve_mode_e</a>. <br /></td></tr>
<tr class="separator:gad429252492888205c9de9a295a724496"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga1cf28216485089df700495e681fbdc29"><td class="memItemLeft" align="right" valign="top"><a id="ga1cf28216485089df700495e681fbdc29"></a>
typedef unsigned </td><td class="memItemRight" valign="bottom"><a class="el" href="group__SolveHandle.html#ga1cf28216485089df700495e681fbdc29">clingo_solve_event_type_t</a></td></tr>
<tr class="memdesc:ga1cf28216485089df700495e681fbdc29"><td class="mdescLeft"> </td><td class="mdescRight">Corresponding type to <a class="el" href="group__SolveHandle.html#ga988c4d39df7949f444f1507896e97450" title="Enumeration of solve events.">clingo_solve_event_type_e</a>. <br /></td></tr>
<tr class="separator:ga1cf28216485089df700495e681fbdc29"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga721ae13385f81fca6b6c6b8f5b0fa416"><td class="memItemLeft" align="right" valign="top">typedef bool(* </td><td class="memItemRight" valign="bottom"><a class="el" href="group__SolveHandle.html#ga721ae13385f81fca6b6c6b8f5b0fa416">clingo_solve_event_callback_t</a>) (<a class="el" href="group__SolveHandle.html#ga1cf28216485089df700495e681fbdc29">clingo_solve_event_type_t</a> type, void *event, void *data, bool *goon)</td></tr>
<tr class="memdesc:ga721ae13385f81fca6b6c6b8f5b0fa416"><td class="mdescLeft"> </td><td class="mdescRight">Callback function called during search to notify when the search is finished or a model is ready. <a href="group__SolveHandle.html#ga721ae13385f81fca6b6c6b8f5b0fa416">More...</a><br /></td></tr>
<tr class="separator:ga721ae13385f81fca6b6c6b8f5b0fa416"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga023c1084a4c01ea6e121a8310efba045"><td class="memItemLeft" align="right" valign="top">typedef struct clingo_solve_handle </td><td class="memItemRight" valign="bottom"><a class="el" href="group__SolveHandle.html#ga023c1084a4c01ea6e121a8310efba045">clingo_solve_handle_t</a></td></tr>
<tr class="memdesc:ga023c1084a4c01ea6e121a8310efba045"><td class="mdescLeft"> </td><td class="mdescRight">Search handle to a solve call. <a href="group__SolveHandle.html#ga023c1084a4c01ea6e121a8310efba045">More...</a><br /></td></tr>
<tr class="separator:ga023c1084a4c01ea6e121a8310efba045"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:ga63eb87834deebecdf9c799d64a3c65a2"><td class="memItemLeft" align="right" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="group__SolveHandle.html#ga63eb87834deebecdf9c799d64a3c65a2">clingo_solve_mode_e</a> { <a class="el" href="group__SolveHandle.html#gga63eb87834deebecdf9c799d64a3c65a2af5a772f277ce9f5bcc442502033ddee5">clingo_solve_mode_async</a> = 1,
<a class="el" href="group__SolveHandle.html#gga63eb87834deebecdf9c799d64a3c65a2a60a9c133be636e68a7d02680c8b9d47e">clingo_solve_mode_yield</a> = 2
}</td></tr>
<tr class="memdesc:ga63eb87834deebecdf9c799d64a3c65a2"><td class="mdescLeft"> </td><td class="mdescRight">Enumeration of solve modes. <a href="group__SolveHandle.html#ga63eb87834deebecdf9c799d64a3c65a2">More...</a><br /></td></tr>
<tr class="separator:ga63eb87834deebecdf9c799d64a3c65a2"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga988c4d39df7949f444f1507896e97450"><td class="memItemLeft" align="right" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="group__SolveHandle.html#ga988c4d39df7949f444f1507896e97450">clingo_solve_event_type_e</a> { <a class="el" href="group__SolveHandle.html#gga988c4d39df7949f444f1507896e97450aabf74b9cf7272e4ec7a0f30191ea1ee8">clingo_solve_event_type_model</a> = 0,
<a class="el" href="group__SolveHandle.html#gga988c4d39df7949f444f1507896e97450a0c8e686296fba330b078201c31ad0b78">clingo_solve_event_type_unsat</a> = 1,
<a class="el" href="group__SolveHandle.html#gga988c4d39df7949f444f1507896e97450a9070101cdf688b8f2ba6e2f968088746">clingo_solve_event_type_statistics</a> = 2,
<a class="el" href="group__SolveHandle.html#gga988c4d39df7949f444f1507896e97450a43118d2a22d1f7ba21f7928811ebca84">clingo_solve_event_type_finish</a> = 3
}</td></tr>
<tr class="memdesc:ga988c4d39df7949f444f1507896e97450"><td class="mdescLeft"> </td><td class="mdescRight">Enumeration of solve events. <a href="group__SolveHandle.html#ga988c4d39df7949f444f1507896e97450">More...</a><br /></td></tr>
<tr class="separator:ga988c4d39df7949f444f1507896e97450"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gae4270b7d4d0174a479307438680007c5"><td class="memItemLeft" align="right" valign="top">CLINGO_VISIBILITY_DEFAULT bool </td><td class="memItemRight" valign="bottom"><a class="el" href="group__SolveHandle.html#gae4270b7d4d0174a479307438680007c5">clingo_solve_handle_get</a> (<a class="el" href="group__SolveHandle.html#ga023c1084a4c01ea6e121a8310efba045">clingo_solve_handle_t</a> *handle, <a class="el" href="group__Control.html#gae917a23b0591d181004ec88c4e3291c1">clingo_solve_result_bitset_t</a> *result)</td></tr>
<tr class="memdesc:gae4270b7d4d0174a479307438680007c5"><td class="mdescLeft"> </td><td class="mdescRight">Get the next solve result. <a href="group__SolveHandle.html#gae4270b7d4d0174a479307438680007c5">More...</a><br /></td></tr>
<tr class="separator:gae4270b7d4d0174a479307438680007c5"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga96d87fd2361f2d92f995cf1d2fc0001c"><td class="memItemLeft" align="right" valign="top">CLINGO_VISIBILITY_DEFAULT void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__SolveHandle.html#ga96d87fd2361f2d92f995cf1d2fc0001c">clingo_solve_handle_wait</a> (<a class="el" href="group__SolveHandle.html#ga023c1084a4c01ea6e121a8310efba045">clingo_solve_handle_t</a> *handle, double timeout, bool *result)</td></tr>
<tr class="memdesc:ga96d87fd2361f2d92f995cf1d2fc0001c"><td class="mdescLeft"> </td><td class="mdescRight">Wait for the specified amount of time to check if the next result is ready. <a href="group__SolveHandle.html#ga96d87fd2361f2d92f995cf1d2fc0001c">More...</a><br /></td></tr>
<tr class="separator:ga96d87fd2361f2d92f995cf1d2fc0001c"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gaf9353c14149a2a16adf0474796871ae1"><td class="memItemLeft" align="right" valign="top">CLINGO_VISIBILITY_DEFAULT bool </td><td class="memItemRight" valign="bottom"><a class="el" href="group__SolveHandle.html#gaf9353c14149a2a16adf0474796871ae1">clingo_solve_handle_model</a> (<a class="el" href="group__SolveHandle.html#ga023c1084a4c01ea6e121a8310efba045">clingo_solve_handle_t</a> *handle, <a class="el" href="group__Model.html#gaaf9a93819f023f3cb8aa80598c46556b">clingo_model_t</a> const **model)</td></tr>
<tr class="memdesc:gaf9353c14149a2a16adf0474796871ae1"><td class="mdescLeft"> </td><td class="mdescRight">Get the next model (or zero if there are no more models). <a href="group__SolveHandle.html#gaf9353c14149a2a16adf0474796871ae1">More...</a><br /></td></tr>
<tr class="separator:gaf9353c14149a2a16adf0474796871ae1"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga96707c84cf7f123cd9122cf3b7c867cb"><td class="memItemLeft" align="right" valign="top">CLINGO_VISIBILITY_DEFAULT bool </td><td class="memItemRight" valign="bottom"><a class="el" href="group__SolveHandle.html#ga96707c84cf7f123cd9122cf3b7c867cb">clingo_solve_handle_core</a> (<a class="el" href="group__SolveHandle.html#ga023c1084a4c01ea6e121a8310efba045">clingo_solve_handle_t</a> *handle, <a class="el" href="group__BasicTypes.html#gaa95dd19334e536397bbad174c8fa4ff8">clingo_literal_t</a> const **core, size_t *size)</td></tr>
<tr class="memdesc:ga96707c84cf7f123cd9122cf3b7c867cb"><td class="mdescLeft"> </td><td class="mdescRight">When a problem is unsatisfiable, get a subset of the assumptions that made the problem unsatisfiable. <a href="group__SolveHandle.html#ga96707c84cf7f123cd9122cf3b7c867cb">More...</a><br /></td></tr>
<tr class="separator:ga96707c84cf7f123cd9122cf3b7c867cb"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga73d71df7adeee92f1d515f52cdcbbac0"><td class="memItemLeft" align="right" valign="top">CLINGO_VISIBILITY_DEFAULT bool </td><td class="memItemRight" valign="bottom"><a class="el" href="group__SolveHandle.html#ga73d71df7adeee92f1d515f52cdcbbac0">clingo_solve_handle_resume</a> (<a class="el" href="group__SolveHandle.html#ga023c1084a4c01ea6e121a8310efba045">clingo_solve_handle_t</a> *handle)</td></tr>
<tr class="memdesc:ga73d71df7adeee92f1d515f52cdcbbac0"><td class="mdescLeft"> </td><td class="mdescRight">Discards the last model and starts the search for the next one. <a href="group__SolveHandle.html#ga73d71df7adeee92f1d515f52cdcbbac0">More...</a><br /></td></tr>
<tr class="separator:ga73d71df7adeee92f1d515f52cdcbbac0"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga3ca184768ef788ca10f0f76bb7ad1353"><td class="memItemLeft" align="right" valign="top">CLINGO_VISIBILITY_DEFAULT bool </td><td class="memItemRight" valign="bottom"><a class="el" href="group__SolveHandle.html#ga3ca184768ef788ca10f0f76bb7ad1353">clingo_solve_handle_cancel</a> (<a class="el" href="group__SolveHandle.html#ga023c1084a4c01ea6e121a8310efba045">clingo_solve_handle_t</a> *handle)</td></tr>
<tr class="memdesc:ga3ca184768ef788ca10f0f76bb7ad1353"><td class="mdescLeft"> </td><td class="mdescRight">Stop the running search and block until done. <a href="group__SolveHandle.html#ga3ca184768ef788ca10f0f76bb7ad1353">More...</a><br /></td></tr>
<tr class="separator:ga3ca184768ef788ca10f0f76bb7ad1353"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga488b76e7240d625bd4066e68a33ab23e"><td class="memItemLeft" align="right" valign="top">CLINGO_VISIBILITY_DEFAULT bool </td><td class="memItemRight" valign="bottom"><a class="el" href="group__SolveHandle.html#ga488b76e7240d625bd4066e68a33ab23e">clingo_solve_handle_close</a> (<a class="el" href="group__SolveHandle.html#ga023c1084a4c01ea6e121a8310efba045">clingo_solve_handle_t</a> *handle)</td></tr>
<tr class="memdesc:ga488b76e7240d625bd4066e68a33ab23e"><td class="mdescLeft"> </td><td class="mdescRight">Stops the running search and releases the handle. <a href="group__SolveHandle.html#ga488b76e7240d625bd4066e68a33ab23e">More...</a><br /></td></tr>
<tr class="separator:ga488b76e7240d625bd4066e68a33ab23e"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<h2 class="groupheader">Typedef Documentation</h2>
<a id="ga721ae13385f81fca6b6c6b8f5b0fa416"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga721ae13385f81fca6b6c6b8f5b0fa416">◆ </a></span>clingo_solve_event_callback_t</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef bool(* clingo_solve_event_callback_t) (<a class="el" href="group__SolveHandle.html#ga1cf28216485089df700495e681fbdc29">clingo_solve_event_type_t</a> type, void *event, void *data, bool *goon)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Callback function called during search to notify when the search is finished or a model is ready. </p>
<p>If a (non-recoverable) clingo API function fails in this callback, it must return false. In case of errors not related to clingo, set error code <a class="el" href="group__BasicTypes.html#ggaebdf91a4187db9abdd2c6ceb971cf13eaf0ac62d4f86f97849bc7fd25dbbfb676" title="errors unrelated to clingo">clingo_error_unknown</a> and return false to stop solving with an error.</p>
<p>The event is either a pointer to a model, a pointer to an int64_t* and a size_t, a pointer to two statistics objects (per step and accumulated statistics), or a solve result. </p><dl class="section attention"><dt>Attention</dt><dd>If the search is finished, the model is NULL.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">event</td><td>the current event. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">data</td><td>user data of the callback </td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">goon</td><td>can be set to false to stop solving </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>whether the call was successful</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__Control.html#ga4b3b7388e75ace676481f6021c4dc66d" title="Solve the currently grounded logic program enumerating its models.">clingo_control_solve()</a> </dd></dl>
</div>
</div>
<a id="ga023c1084a4c01ea6e121a8310efba045"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga023c1084a4c01ea6e121a8310efba045">◆ </a></span>clingo_solve_handle_t</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef struct clingo_solve_handle <a class="el" href="group__SolveHandle.html#ga023c1084a4c01ea6e121a8310efba045">clingo_solve_handle_t</a></td>
</tr>
</table>
</div><div class="memdoc">
<p>Search handle to a solve call. </p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__Control.html#ga4b3b7388e75ace676481f6021c4dc66d" title="Solve the currently grounded logic program enumerating its models.">clingo_control_solve()</a> </dd></dl>
</div>
</div>
<h2 class="groupheader">Enumeration Type Documentation</h2>
<a id="ga988c4d39df7949f444f1507896e97450"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga988c4d39df7949f444f1507896e97450">◆ </a></span>clingo_solve_event_type_e</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">enum <a class="el" href="group__SolveHandle.html#ga988c4d39df7949f444f1507896e97450">clingo_solve_event_type_e</a></td>
</tr>
</table>
</div><div class="memdoc">
<p>Enumeration of solve events. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="gga988c4d39df7949f444f1507896e97450aabf74b9cf7272e4ec7a0f30191ea1ee8"></a>clingo_solve_event_type_model </td><td class="fielddoc"><p>Issued if a model is found. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga988c4d39df7949f444f1507896e97450a0c8e686296fba330b078201c31ad0b78"></a>clingo_solve_event_type_unsat </td><td class="fielddoc"><p>Issued if an optimization problem is found unsatisfiable. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga988c4d39df7949f444f1507896e97450a9070101cdf688b8f2ba6e2f968088746"></a>clingo_solve_event_type_statistics </td><td class="fielddoc"><p>Issued when the statistics can be updated. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga988c4d39df7949f444f1507896e97450a43118d2a22d1f7ba21f7928811ebca84"></a>clingo_solve_event_type_finish </td><td class="fielddoc"><p>Issued if the search has completed. </p>
</td></tr>
</table>
</div>
</div>
<a id="ga63eb87834deebecdf9c799d64a3c65a2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga63eb87834deebecdf9c799d64a3c65a2">◆ </a></span>clingo_solve_mode_e</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">enum <a class="el" href="group__SolveHandle.html#ga63eb87834deebecdf9c799d64a3c65a2">clingo_solve_mode_e</a></td>
</tr>
</table>
</div><div class="memdoc">
<p>Enumeration of solve modes. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="gga63eb87834deebecdf9c799d64a3c65a2af5a772f277ce9f5bcc442502033ddee5"></a>clingo_solve_mode_async </td><td class="fielddoc"><p>Enable non-blocking search. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga63eb87834deebecdf9c799d64a3c65a2a60a9c133be636e68a7d02680c8b9d47e"></a>clingo_solve_mode_yield </td><td class="fielddoc"><p>Yield models in calls to clingo_solve_handle_model. </p>
</td></tr>
</table>
</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga3ca184768ef788ca10f0f76bb7ad1353"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga3ca184768ef788ca10f0f76bb7ad1353">◆ </a></span>clingo_solve_handle_cancel()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">CLINGO_VISIBILITY_DEFAULT bool clingo_solve_handle_cancel </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__SolveHandle.html#ga023c1084a4c01ea6e121a8310efba045">clingo_solve_handle_t</a> * </td>
<td class="paramname"><em>handle</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Stop the running search and block until done. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">handle</td><td>the target </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>whether the call was successful; might set one of the following error codes:<ul>
<li><a class="el" href="group__BasicTypes.html#ggaebdf91a4187db9abdd2c6ceb971cf13eaa14a0926eb3e653fcc13299b33d8d348" title="memory could not be allocated">clingo_error_bad_alloc</a></li>
<li><a class="el" href="group__BasicTypes.html#ggaebdf91a4187db9abdd2c6ceb971cf13eaf43eebc9503fef8d1b2b85f99bb63221" title="errors only detectable at runtime like invalid input">clingo_error_runtime</a> if solving fails </li>
</ul>
</dd></dl>
</div>
</div>
<a id="ga488b76e7240d625bd4066e68a33ab23e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga488b76e7240d625bd4066e68a33ab23e">◆ </a></span>clingo_solve_handle_close()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">CLINGO_VISIBILITY_DEFAULT bool clingo_solve_handle_close </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__SolveHandle.html#ga023c1084a4c01ea6e121a8310efba045">clingo_solve_handle_t</a> * </td>
<td class="paramname"><em>handle</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Stops the running search and releases the handle. </p>
<p>Blocks until the search is stopped (as if an implicit cancel was called before the handle is released).</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">handle</td><td>the target </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>whether the call was successful; might set one of the following error codes:<ul>
<li><a class="el" href="group__BasicTypes.html#ggaebdf91a4187db9abdd2c6ceb971cf13eaa14a0926eb3e653fcc13299b33d8d348" title="memory could not be allocated">clingo_error_bad_alloc</a></li>
<li><a class="el" href="group__BasicTypes.html#ggaebdf91a4187db9abdd2c6ceb971cf13eaf43eebc9503fef8d1b2b85f99bb63221" title="errors only detectable at runtime like invalid input">clingo_error_runtime</a> if solving fails </li>
</ul>
</dd></dl>
<dl class="section examples"><dt>Examples</dt><dd><a class="el" href="application_8c-example.html#a5">application.c</a>, <a class="el" href="ast_8c-example.html#a20">ast.c</a>, <a class="el" href="backend_8c-example.html#a12">backend.c</a>, <a class="el" href="configuration_8c-example.html#a12">configuration.c</a>, <a class="el" href="control_8c-example.html#a12">control.c</a>, <a class="el" href="model_8c-example.html#a20">model.c</a>, <a class="el" href="propagator_8c-example.html#a30">propagator.c</a>, <a class="el" href="solve-async_8c-example.html#a18">solve-async.c</a>, <a class="el" href="statistics_8c-example.html#a20">statistics.c</a>, and <a class="el" href="theory-atoms_8c-example.html#a12">theory-atoms.c</a>.</dd>
</dl>
</div>
</div>
<a id="ga96707c84cf7f123cd9122cf3b7c867cb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga96707c84cf7f123cd9122cf3b7c867cb">◆ </a></span>clingo_solve_handle_core()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">CLINGO_VISIBILITY_DEFAULT bool clingo_solve_handle_core </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__SolveHandle.html#ga023c1084a4c01ea6e121a8310efba045">clingo_solve_handle_t</a> * </td>
<td class="paramname"><em>handle</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="group__BasicTypes.html#gaa95dd19334e536397bbad174c8fa4ff8">clingo_literal_t</a> const ** </td>
<td class="paramname"><em>core</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t * </td>
<td class="paramname"><em>size</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>When a problem is unsatisfiable, get a subset of the assumptions that made the problem unsatisfiable. </p>
<p>If the program is not unsatisfiable, core is set to NULL and size to zero.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">handle</td><td>the target </td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">core</td><td>pointer where to store the core </td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">size</td><td>size of the given array </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>whether the call was successful; might set one of the following error codes:<ul>
<li><a class="el" href="group__BasicTypes.html#ggaebdf91a4187db9abdd2c6ceb971cf13eaa14a0926eb3e653fcc13299b33d8d348" title="memory could not be allocated">clingo_error_bad_alloc</a> </li>
</ul>
</dd></dl>
</div>
</div>
<a id="gae4270b7d4d0174a479307438680007c5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gae4270b7d4d0174a479307438680007c5">◆ </a></span>clingo_solve_handle_get()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">CLINGO_VISIBILITY_DEFAULT bool clingo_solve_handle_get </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__SolveHandle.html#ga023c1084a4c01ea6e121a8310efba045">clingo_solve_handle_t</a> * </td>
<td class="paramname"><em>handle</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="group__Control.html#gae917a23b0591d181004ec88c4e3291c1">clingo_solve_result_bitset_t</a> * </td>
<td class="paramname"><em>result</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Get the next solve result. </p>
<p>Blocks until the result is ready. When yielding partial solve results can be obtained, i.e., when a model is ready, the result will be satisfiable but neither the search exhausted nor the optimality proven.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">handle</td><td>the target </td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>the solve result </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>whether the call was successful; might set one of the following error codes:<ul>
<li><a class="el" href="group__BasicTypes.html#ggaebdf91a4187db9abdd2c6ceb971cf13eaa14a0926eb3e653fcc13299b33d8d348" title="memory could not be allocated">clingo_error_bad_alloc</a></li>
<li><a class="el" href="group__BasicTypes.html#ggaebdf91a4187db9abdd2c6ceb971cf13eaf43eebc9503fef8d1b2b85f99bb63221" title="errors only detectable at runtime like invalid input">clingo_error_runtime</a> if solving fails </li>
</ul>
</dd></dl>
<dl class="section examples"><dt>Examples</dt><dd><a class="el" href="application_8c-example.html#a4">application.c</a>, <a class="el" href="ast_8c-example.html#a19">ast.c</a>, <a class="el" href="backend_8c-example.html#a11">backend.c</a>, <a class="el" href="configuration_8c-example.html#a11">configuration.c</a>, <a class="el" href="control_8c-example.html#a11">control.c</a>, <a class="el" href="model_8c-example.html#a19">model.c</a>, <a class="el" href="propagator_8c-example.html#a29">propagator.c</a>, <a class="el" href="solve-async_8c-example.html#a15">solve-async.c</a>, <a class="el" href="statistics_8c-example.html#a19">statistics.c</a>, and <a class="el" href="theory-atoms_8c-example.html#a11">theory-atoms.c</a>.</dd>
</dl>
</div>
</div>
<a id="gaf9353c14149a2a16adf0474796871ae1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaf9353c14149a2a16adf0474796871ae1">◆ </a></span>clingo_solve_handle_model()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">CLINGO_VISIBILITY_DEFAULT bool clingo_solve_handle_model </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__SolveHandle.html#ga023c1084a4c01ea6e121a8310efba045">clingo_solve_handle_t</a> * </td>
<td class="paramname"><em>handle</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="group__Model.html#gaaf9a93819f023f3cb8aa80598c46556b">clingo_model_t</a> const ** </td>
<td class="paramname"><em>model</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Get the next model (or zero if there are no more models). </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">handle</td><td>the target </td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">model</td><td>the model (it is NULL if there are no more models) </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>whether the call was successful; might set one of the following error codes:<ul>
<li><a class="el" href="group__BasicTypes.html#ggaebdf91a4187db9abdd2c6ceb971cf13eaa14a0926eb3e653fcc13299b33d8d348" title="memory could not be allocated">clingo_error_bad_alloc</a></li>
<li><a class="el" href="group__BasicTypes.html#ggaebdf91a4187db9abdd2c6ceb971cf13eaf43eebc9503fef8d1b2b85f99bb63221" title="errors only detectable at runtime like invalid input">clingo_error_runtime</a> if solving fails </li>
</ul>
</dd></dl>
<dl class="section examples"><dt>Examples</dt><dd><a class="el" href="application_8c-example.html#a3">application.c</a>, <a class="el" href="ast_8c-example.html#a18">ast.c</a>, <a class="el" href="backend_8c-example.html#a10">backend.c</a>, <a class="el" href="configuration_8c-example.html#a10">configuration.c</a>, <a class="el" href="control_8c-example.html#a10">control.c</a>, <a class="el" href="model_8c-example.html#a18">model.c</a>, <a class="el" href="propagator_8c-example.html#a28">propagator.c</a>, <a class="el" href="statistics_8c-example.html#a18">statistics.c</a>, and <a class="el" href="theory-atoms_8c-example.html#a10">theory-atoms.c</a>.</dd>
</dl>
</div>
</div>
<a id="ga73d71df7adeee92f1d515f52cdcbbac0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga73d71df7adeee92f1d515f52cdcbbac0">◆ </a></span>clingo_solve_handle_resume()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">CLINGO_VISIBILITY_DEFAULT bool clingo_solve_handle_resume </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__SolveHandle.html#ga023c1084a4c01ea6e121a8310efba045">clingo_solve_handle_t</a> * </td>
<td class="paramname"><em>handle</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Discards the last model and starts the search for the next one. </p>
<p>If the search has been started asynchronously, this function continues the search in the background.</p>
<dl class="section note"><dt>Note</dt><dd>This function does not block.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">handle</td><td>the target </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>whether the call was successful; might set one of the following error codes:<ul>
<li><a class="el" href="group__BasicTypes.html#ggaebdf91a4187db9abdd2c6ceb971cf13eaa14a0926eb3e653fcc13299b33d8d348" title="memory could not be allocated">clingo_error_bad_alloc</a></li>
<li><a class="el" href="group__BasicTypes.html#ggaebdf91a4187db9abdd2c6ceb971cf13eaf43eebc9503fef8d1b2b85f99bb63221" title="errors only detectable at runtime like invalid input">clingo_error_runtime</a> if solving fails </li>
</ul>
</dd></dl>
<dl class="section examples"><dt>Examples</dt><dd><a class="el" href="application_8c-example.html#a2">application.c</a>, <a class="el" href="ast_8c-example.html#a17">ast.c</a>, <a class="el" href="backend_8c-example.html#a9">backend.c</a>, <a class="el" href="configuration_8c-example.html#a9">configuration.c</a>, <a class="el" href="control_8c-example.html#a9">control.c</a>, <a class="el" href="model_8c-example.html#a17">model.c</a>, <a class="el" href="propagator_8c-example.html#a27">propagator.c</a>, <a class="el" href="statistics_8c-example.html#a17">statistics.c</a>, and <a class="el" href="theory-atoms_8c-example.html#a9">theory-atoms.c</a>.</dd>
</dl>
</div>
</div>
<a id="ga96d87fd2361f2d92f995cf1d2fc0001c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga96d87fd2361f2d92f995cf1d2fc0001c">◆ </a></span>clingo_solve_handle_wait()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">CLINGO_VISIBILITY_DEFAULT void clingo_solve_handle_wait </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__SolveHandle.html#ga023c1084a4c01ea6e121a8310efba045">clingo_solve_handle_t</a> * </td>
<td class="paramname"><em>handle</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">double </td>
<td class="paramname"><em>timeout</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool * </td>
<td class="paramname"><em>result</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Wait for the specified amount of time to check if the next result is ready. </p>
<p>If the time is set to zero, this function can be used to poll if the search is still active. If the time is negative, the function blocks until the search is finished.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">handle</td><td>the target </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">timeout</td><td>the maximum time to wait </td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">result</td><td>whether the search has finished </td></tr>
</table>
</dd>
</dl>
</div>
</div>
</div><!-- contents -->
<!-- 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>