.TH LIBNORMALFORM_ANY 3 LIBNORMALFORM .SH NAME libnormalform_any \- Existential qualifier .SH SYNOPSIS .nf #include struct libnormalform_mapping { void *\fIkey\fP; void *\fIvalue\fP; }; struct libnormalform_map { struct libnormalform_mapping *\fImappings\fP; size_t \fInmappings\fP; void *\fIuser_data\fP; const char *\fIidentifier\fP; struct libnormalform_map *\fIcopy_for_clone\fP; }; LIBNORMALFORM_SENTENCE * libnormalform_any(struct libnormalform_map *\fId\fP, LIBNORMALFORM_SENTENCE *\fIk\fP, LIBNORMALFORM_SENTENCE *\fIv\fP); LIBNORMALFORM_SENTENCE * libnormalform_exists(struct libnormalform_map *\fId\fP, LIBNORMALFORM_SENTENCE *\fIk\fP); LIBNORMALFORM_SENTENCE * libnormalform_nexists(struct libnormalform_map *\fId\fP, LIBNORMALFORM_SENTENCE *\fIk\fP); LIBNORMALFORM_SENTENCE * libnormalform_existentially(struct libnormalform_map *\fId\fP, LIBNORMALFORM_SENTENCE *\fIv\fP); LIBNORMALFORM_SENTENCE * libnormalform_empty(struct libnormalform_map *\fId\fP); LIBNORMALFORM_SENTENCE * libnormalform_nonempty(struct libnormalform_map *\fId\fP); .fi .PP Link with .IR -lnormalform . .SH DESCRIPTION The .BR libnormalform_any () function creates a sentence that is true when and only when the sentence .I v is true for the .I .value for at least one element in .I d for which .I k is also true for the .I .key of the element. .PP The .BR libnormalform_exists () function creates a sentence that is true when and only when the sentence .I k is true for the .I .key of at least one element in .IR d . .PP The .BR libnormalform_nexists () function creates a sentence that is true when and only when the sentence .I k is false for the .I .key of every element in .IR d . .PP The .BR libnormalform_existentially () function creates a sentence that is true when and only when the sentence .I v is true for the .I .value of at least one element in .IR d . .PP The .BR libnormalform_empty () function creates a sentence that is true when and only when .IR d contains no elements. .PP The .BR libnormalform_nonempty () function creates a sentence that is true when and only when .IR d contains at least one element. .PP .I d->mappings and .I d->nmappings is used only be the .BR libnormalform_evaluate (3) function and must be set before .BR libnormalform_evaluate (3) is called, but need not be set earlier. .I d->nmappings shall be set to number of elements in the qualifers domain of interest, and .I d->mappings shall be set to the list of elements in the domain. Each element shall have its .I .key set to the value the antecedent formula .RI ( k ) is tested on, and .I .value set to the value the predicate formula .RI ( v ) is tested on; these fields may be .IR NULL , and are ultimately evaluated via arguments passed to the .BR libnormalform_function (3) function but may undergo transformation via arguments passed to the .BR libnormalform_transformation (3) function on the way. .PP The values .I d->mappings and .I d->nmappings may be set differently every time the .BR libnormalform_evaluate (3) is called. .PP Although unused, the .BR libnormalform_empty () and .BR libnormalform_nonempty () functions require that .I d->mappings is properly set up (although the values in it can all be .IR NULL ) before the .BR libnormalform_evaluate (3) function is called. .PP See .BR libnormalform_to_string (3) for the purpose of .IR d->identifier , it need not be set before the .BR libnormalform_to_string (3) function is called. .PP See .BR libnormalform_clone (3) for the purpose of .IR d->copy_for_clone , it need not be set before the .BR libnormalform_clone (3) function is called. .PP The application can set .I d->user_data set freely, and can opt to leave it unset. It is never used or reference by the library, but it could be used by the application to identify the domain. .PP .I d must not be .IR NULL . .PP The returned pointer shall either be deallocated with the .BR libnormalform_free (3) function or be relinquished by being used as part of another sentence. .PP These functions adopt the ownership of any .I LIBNORMALFORM_SENTENCE * passed into it. Therefore, the user shall not attempt to deallocate input sentences. This holds even on failure: if the function fails, input sentences are deallocated. .SH RETURN VALUE Upon successful completion, the .BR libnormalform_any (), .BR libnormalform_exists (), .BR libnormalform_nexists (), .BR libnormalform_existentially (), .BR libnormalform_empty (), and .BR libnormalform_nonempty (), functions return an object representing the sentence; otherwise, the functions return .I NULL and set .I errno to indicate the error. .SH ERRORS The .BR libnormalform_any (), .BR libnormalform_exists (), .BR libnormalform_nexists (), .BR libnormalform_existentially (), .BR libnormalform_empty (), and .BR libnormalform_nonempty (), functions fail if: .TP .B ENOMEM Insufficient memory was available to create the sentence object. .PP These functions will also fail without setting .I errno if .I k or .I v is .IR NULL . .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_any (), .br .BR libnormalform_exists (), .br .BR libnormalform_nexists (), .br .BR libnormalform_existentially () T} Thread safety MT-Safe race:\fIk\fP,\fIv\fP T{ .BR libnormalform_empty (), .br .BR libnormalform_nonempty () T} Thread safety MT-Safe T{ .BR libnormalform_any (), .br .BR libnormalform_exists (), .br .BR libnormalform_nexists (), .br .BR libnormalform_existentially (), .br .BR libnormalform_empty (), .br .BR libnormalform_nonempty () T} Async-signal safety AS-Unsafe heap T{ .BR libnormalform_any (), .br .BR libnormalform_exists (), .br .BR libnormalform_nexists (), .br .BR libnormalform_existentially (), .br .BR libnormalform_empty (), .br .BR libnormalform_nonempty () T} Async-cancel safety AC-Safe mem, AC-Unsafe heap .TE .SH SEE ALSO .BR libnormalform (7), .BR libnormalform_function (3)