.TH LIBNORMALFORM_CNF 3 LIBNORMALFORM .SH NAME libnormalform_cnf \- Reduce and express in conjunctive normal form .SH SYNOPSIS .nf #include /* See \fBlibnormalform_express\fP(3) for relevant types and constants */ struct libnormalform_term * libnormalform_cnf(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_cnf () 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_CONJUNCTION clause containing only .I LIBNORMALFORM_DISJUNCTION 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 conjunctive normal form. .PP Each .RI non- NULL .I .term.qualifier.antecedent is expressed in conjunctive normal form. .PP Each .I .term.qualifier.predicate is expressed in conjunctive normal form. .SH RETURN VALUE Upon successful completion, the .BR libnormalform_cnf () 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_cnf () 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_cnf () T} Thread safety MT-Safe race:\fIthis\fP T{ .BR libnormalform_cnf () T} Async-signal safety AS-Unsafe heap T{ .BR libnormalform_cnf () T} Async-cancel safety AC-Safe mem, AC-Unsafe heap .TE .SH SEE ALSO .BR libnormalform (7), .BR libnormalform_express (3), .BR libnormalform_dnf (3), .BR libnormalform_cdnf (3)