import { LabelOrCondition } from './types.js';
/**
 * Takes a label tree with an AND-root and converts it to Conjunctive Normal Form
 * @param root - the original label tree
 * @returns an equivalent CNF tree
 */
export declare function convertToCNF(root: LabelOrCondition): LabelOrCondition;
/**
 * Helper method to check if we are adding a duplicate child-condition/label to an existing list of children
 * Exported for unit testing
 * @param existingChildren
 * @param newChild
 * @returns
 */
export declare function childAlreadyExists(existingChildren: LabelOrCondition[], newChild: LabelOrCondition): boolean;
/**
 * Takes a CNF-tree and simplifies away redudant conditions and tautologies
 *
 * Tautologies are the conditions that are true for any label, like OR(!A, !B) or OR(!A, A)
 *
 * We can also simplify away conditions covered by another like AND(A, OR(A,B) = AND(A)
 *
 * Finally we can also simplify OR(!A, B, C, D) to !A, since this case includes the specific cases B,C,D
 *
 * Does some simplifications of the tree to remove redudant conditions. Some of these simplifications
 * ignore positions, rather than taking the first instance of a rule
 * @param root
 * @returns
 */
export declare function simplifyAndRemoveTautologies(root: LabelOrCondition): LabelOrCondition;
export declare function removeDuplicates(labelTree: LabelOrCondition): LabelOrCondition;
/**
 * Converts a label tree with arbitrary NOTs to one without NOTs on AND/OR/NOT conditions
 * This is achieved by removing double negations and "pushing in" NOTs to OR/ANDs using De Morgan's laws see
 * https://en.wikipedia.org/wiki/De_Morgan%27s_laws
 * @param labelTree
 * @returns a transformed copy of the tree with only NOTs above label leaves
 */
export declare function pushInNots(labelTree: LabelOrCondition): LabelOrCondition;
export declare const isAnyNode: (n: LabelOrCondition) => boolean;
export declare const isNotAnyNode: (n: LabelOrCondition) => boolean;
/**
 * Converts a label tree with ANYs to one without ANYs by simplifying like
 * AND(ANY, ...) = AND(redudant, ...) = AND(...)
 *
 * OR(ANY, ...) = OR(ANY) = ANY
 *
 * AND(NOT(ANY), ...) = NOT(ANY)
 *
 * OR(NOT(ANY), ...) = OR(...)
 * Doing this bottom up we ensure we either get ANY/NOT(ANY) or the existing root without any ANYs inside
 * @param labelTree
 * @returns a transformed copy of the tree such that the new root is either an ANY/NOT(ANY) node itself or has no inner ANYs
 */
export declare function removeInnerAnys(labelTree: LabelOrCondition): LabelOrCondition;
