aboutsummaryrefslogtreecommitdiffstats
path: root/man3/libnormalform_dnf.3
blob: 825ff1b7b4d60e80ea2d597dffb328be58b576ad (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
.TH LIBNORMALFORM_DNF 3 LIBNORMALFORM
.SH NAME
libnormalform_dnf \- Reduce and express in disjunctive normal form

.SH SYNOPSIS
.nf
#include <libnormalform.h>

/* See \fBlibnormalform_express\fP(3) for relevant types and constants */

struct libnormalform_term *
libnormalform_dnf(LIBNORMALFORM_SENTENCE *\fIthis\fP, uint64_t \fIflags\fP,
                  const struct libnormalform_analysers *\fIanalysers\fP);
.fi
.PP
Link with
.IR -lnormalform .

.SH DESCRIPTION
The
.BR libnormalform_dnf ()
function is similar to the
.BR libnormalform_express (3)
function, please refer to
.BR libnormalform_express (3)
for a detailed explanation. There are however
the following differences:
.PP
The result will never contain a
.I LIBNORMALFORM_EXCLUSIVE_DISJUNCTION
clause, instead these are always relax
to disjunctions
.RI ( LIBNORMALFORM_RELAX_XOR ),
or reduced to an equivalent form if the
.I LIBNORMALFORM_REDUCE_XOR
flag is used.
.PP
.I LIBNORMALFORM_CONJUNCTION
and
.I LIBNORMALFORM_DISJUNCTION
clauses in the result can be singleton
clauses.
.PP
The root term is always a
.I LIBNORMALFORM_DISJUNCTION
clause containing only
.I LIBNORMALFORM_CONJUNCTION
clauses, each containing only literals
(boolean variables and boolean-output
functions), input transformations on
literals, and qualifications. That is
the returned expression is always
.I this
(or some relaxation) expressed in
disjunctive normal form.
.PP
Each
.RI non- NULL
.I .term.qualifier.antecedent
is expressed in disjunctive normal form.
.PP
Each
.I .term.qualifier.predicate
is expressed in disjunctive normal form.

.SH RETURN VALUE
Upon successful completion, the
.BR libnormalform_dnf ()
function return an object representing
the sentence, which is to be deallocated
by the application using the
.BR libnormalform_free (3)
function; otherwise, the function returns
.I NULL
and set
.I errno
to indicate the error; if the function
fails because an application-provided
callback function fails,
.I errno
will remain as set by that function
(or be unmodified if that function did
not set
.IR errno ).

.SH ERRORS
The
.BR libnormalform_dnf ()
function fails if:
.TP
.B ENOMEM
Insufficient memory was available to
create the representation of the sentence.
.TP
.B EINVAL
.I flags
contain unsupported options.

.SH ATTRIBUTES
For an explanation of the terms used in this
section, see
.BR attributes (7)
and
.IR "info \(dq(libc)POSIX Safety Concepts\(dq" .
.TS
allbox;
lb lb lb
l l l.
Interface	Attribute	Value
T{
.BR libnormalform_dnf ()
T}	Thread safety	MT-Safe race:\fIthis\fP
T{
.BR libnormalform_dnf ()
T}	Async-signal safety	AS-Unsafe heap
T{
.BR libnormalform_dnf ()
T}	Async-cancel safety	AC-Safe mem, AC-Unsafe heap
.TE

.SH SEE ALSO
.BR libnormalform (7),
.BR libnormalform_express (3),
.BR libnormalform_cnf (3),
.BR libnormalform_cdnf (3)