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_clause_cmp__.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 libnormalform_clause_cmp__.c (limited to 'libnormalform_clause_cmp__.c') diff --git a/libnormalform_clause_cmp__.c b/libnormalform_clause_cmp__.c new file mode 100644 index 0000000..407ea11 --- /dev/null +++ b/libnormalform_clause_cmp__.c @@ -0,0 +1,24 @@ +/* See LICENSE file for copyright and license details. */ +#include "common.h" +#ifndef TEST + + +int +(libnormalform_clause_cmp__)(struct expression *a, struct expression *b) +{ + size_t i = 0, j = 0, n = a->nterms, m = b->nterms; + int cmp; + for (; i < n && j < m; i++, j++) { + cmp = libnormalform_literal_cmp__(a->terms[i], b->terms[j]); + if (cmp) + return cmp; + } + return (i < n) - (j < m); +} + + +#else + +TODO_TEST + +#endif -- cgit v1.3.1