MCPcopy Create free account
hub / github.com/cortex-js/compute-engine / containsSelfReference

Function containsSelfReference

src/compute-engine/sequence.ts:652–668  ·  view source on GitHub ↗
(
  expr: Expression,
  seqName: string
)

Source from the content-addressed store, hash-verified

650 if (!constraintsExpr) return true;
651
652 // A constraint that reads the term that it checks, also through other
653 // terms, makes the index not valid. Without this, the check of the
654 // term starts again in the check, with no end. The checks that are in
655 // progress are also limited in depth, as the recursive computations
656 // of terms are (`MAX_RECURSION_DEPTH`).
657 const key = indexKeyOf(indices);
658 if (constraintChecks.has(key)) return false;
659 if (recursionDepth >= MAX_RECURSION_DEPTH) {
660 stopSequenceReads();
661 return false;
662 }
663 constraintChecks.add(key);
664 recursionDepth += 1;
665 try {
666 return checkConstraints(engine, constraintsExpr, variables, indices);
667 } finally {
668 recursionDepth -= 1;
669 constraintChecks.delete(key);
670 }
671 };

Callers 1

core.tsFile · 0.90

Calls 2

isFunctionFunction · 0.90
isSymbolFunction · 0.90

Tested by

no test coverage detected