From 77ade8d20906fe9ca2cf6788ff1e1437e0912868 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Mon, 1 Jun 2026 19:07:14 +0200 Subject: Second commit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- libnormalform_contains_clause__.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 libnormalform_contains_clause__.c (limited to 'libnormalform_contains_clause__.c') diff --git a/libnormalform_contains_clause__.c b/libnormalform_contains_clause__.c new file mode 100644 index 0000000..6736e4a --- /dev/null +++ b/libnormalform_contains_clause__.c @@ -0,0 +1,31 @@ +/* See LICENSE file for copyright and license details. */ +#include "common.h" +#ifndef TEST + + +int +(libnormalform_contains_clause__)(struct expression *this, struct expression *clause, size_t ignore) +{ + size_t i; + int cmp; + if (ignore > this->nterms) + ignore = this->nterms; + for (i = 0; i < ignore; i++) { + cmp = libnormalform_clause_cmp__(clause, this->terms[i]); + if (cmp >= 0) + return !cmp; + } + for (i++; i < this->nterms; i++) { + cmp = libnormalform_clause_cmp__(clause, this->terms[i]); + if (cmp >= 0) + return !cmp; + } + return 0; +} + + +#else + +TODO_TEST + +#endif -- cgit v1.3.1