aboutsummaryrefslogtreecommitdiffstats
path: root/man3/libnormalform_all.3
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2024-07-19 01:29:42 +0200
committerMattias Andrée <maandree@kth.se>2024-07-19 01:29:42 +0200
commit4294ec0ed06ee34920c9edaeebaeb8b65c720791 (patch)
treee0cded59452597c04fb38f403745a384675cb5f9 /man3/libnormalform_all.3
downloadlibnormalform-4294ec0ed06ee34920c9edaeebaeb8b65c720791.tar.gz
libnormalform-4294ec0ed06ee34920c9edaeebaeb8b65c720791.tar.bz2
libnormalform-4294ec0ed06ee34920c9edaeebaeb8b65c720791.tar.xz
First commit
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--man3/libnormalform_all.3202
1 files changed, 202 insertions, 0 deletions
diff --git a/man3/libnormalform_all.3 b/man3/libnormalform_all.3
new file mode 100644
index 0000000..901bba2
--- /dev/null
+++ b/man3/libnormalform_all.3
@@ -0,0 +1,202 @@
+.TH LIBNORMALFORM_ALL 3 LIBNORMALFORM
+.SH NAME
+libnormalform_all \- Universal qualifier
+
+.SH SYNOPSIS
+.nf
+#include <libnormalform.h>
+
+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_all(struct libnormalform_map *\fId\fP, LIBNORMALFORM_SENTENCE *\fIk\fP, LIBNORMALFORM_SENTENCE *\fIv\fP);
+
+LIBNORMALFORM_SENTENCE *
+libnormalform_universally(struct libnormalform_map *\fId\fP, LIBNORMALFORM_SENTENCE *\fIv\fP);
+.fi
+.PP
+Link with
+.IR -lnormalform .
+
+.SH DESCRIPTION
+The
+.BR libnormalform_all ()
+function creates a sentence that is true
+when and only when the sentence
+.I v
+is true for the
+.I .value
+for every element in
+.I d
+for which
+.I k
+is also true for the
+.I .key
+of the element.
+.PP
+The
+.BR libnormalform_universally ()
+function creates a sentence that is true
+when and only when the sentence
+.I v
+is true for the
+.I .value
+of every element in
+.IR d .
+.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
+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_all ()
+and
+.BR libnormalform_universally ()
+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_all ()
+and
+.BR libnormalform_universally ()
+functions fails if:
+.TP
+.I 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_all (),
+.br
+.BR libnormalform_universally ()
+T} Thread safety MT-Safe race:\fIk\fP,\fIv\fP
+T{
+.BR libnormalform_all (),
+.br
+.BR libnormalform_universally ()
+T} Async-signal safety AS-Unsafe heap
+T{
+.BR libnormalform_all (),
+.br
+.BR libnormalform_universally ()
+T} Async-cancel safety AC-Safe mem, AC-Unsafe heap
+.TE
+
+.SH SEE ALSO
+.BR libnormalform (7),
+.BR libnormalform_function (3)