schema compile FEATURE introduction of dependency sets

Dependency sets are sets of modules that (may)
depend on each other. In practice that means that
whenever a module from the dep set is (re)compiled,
all the other implemented modules in the dep set
must also be (re)compiled.

Also, every compilation is now split into compiling
each dep set separately since all the modules cannot
depend on each other in any way. This resulted in
splitting unres into global one (that is actually
used only for reverting any changes) and specific
unres for dep sets, which is always resolved at the
end of a single dep set compilation.

Finally, functions for checking that a module needs
to be compiled or recompiled were added. These allow
to split dep sets and not drag a redundant dependent
module (such as ietf-inet-types or ietf-yang-types
that are imported in almost all modules, which would
always result in creating a single dep set).
diff --git a/src/tree_schema_helpers.c b/src/tree_schema_helpers.c
index 242dc8e..82a5610 100644
--- a/src/tree_schema_helpers.c
+++ b/src/tree_schema_helpers.c
@@ -1935,3 +1935,39 @@
 
     return parent;
 }
+
+ly_bool
+lys_has_recompiled(const struct lys_module *mod)
+{
+    LY_ARRAY_COUNT_TYPE u;
+
+    if (LYSP_HAS_RECOMPILED(mod->parsed)) {
+        return 1;
+    }
+
+    LY_ARRAY_FOR(mod->parsed->includes, u) {
+        if (LYSP_HAS_RECOMPILED(mod->parsed->includes[u].submodule)) {
+            return 1;
+        }
+    }
+
+    return 0;
+}
+
+ly_bool
+lys_has_compiled(const struct lys_module *mod)
+{
+    LY_ARRAY_COUNT_TYPE u;
+
+    if (LYSP_HAS_COMPILED(mod->parsed)) {
+        return 1;
+    }
+
+    LY_ARRAY_FOR(mod->parsed->includes, u) {
+        if (LYSP_HAS_COMPILED(mod->parsed->includes[u].submodule)) {
+            return 1;
+        }
+    }
+
+    return 0;
+}