+static bool
+interaction_contains (const struct interaction *iact, const struct variable *v)
+{
+ for (size_t i = 0; i < iact->n_vars; i++)
+ if (iact->vars[i] == v)
+ return true;
+ return false;
+}
+
+/* Returns true iff the variables in X->VARS are a subset (proper or otherwise)
+ of the variables in Y->VARS. */
+bool
+interaction_is_subset (const struct interaction *x,
+ const struct interaction *y)
+{
+ if (x->n_vars > y->n_vars)
+ return false;
+
+ for (size_t i = 0; i < x->n_vars; i++)
+ if (!interaction_contains (y, x->vars[i]))
+ return false;
+
+ return true;
+}
+
+/* Prints the variables in IACT on stdout, for debugging purposes. */