@@ -3,7 +3,7 @@ import { WordSet } from "./word-set";
33import * as Iter from "./iter" ;
44import { MapFABuilderNode } from "./iter" ;
55import { MaxCharacterError } from "./errors" ;
6- import { FACreationOptions , TransitionIterable , TransitionIterator } from "./fa-types" ;
6+ import { TransitionIterable , TransitionIterator } from "./fa-types" ;
77import { wordSetsToWords } from "./words" ;
88
99/**
@@ -13,20 +13,16 @@ import { wordSetsToWords } from "./words";
1313 *
1414 * @param left
1515 * @param right
16- * @param options
16+ * @param maxNodes
1717 */
1818export function getIntersectionIterator < L , R > (
1919 left : TransitionIterable < L > ,
2020 right : TransitionIterable < R > ,
21- options ?: Readonly < FACreationOptions >
21+ maxNodes : number = 10_000
2222) : TransitionIterator < MapFABuilderNode > {
2323 MaxCharacterError . assert ( left , right , "TransitionIterable" ) ;
2424
25- return Iter . intersection (
26- new Iter . MapFABuilder ( options ?. maxNodes ?? 10_000 ) ,
27- left . transitionIterator ( ) ,
28- right . transitionIterator ( )
29- ) ;
25+ return Iter . intersection ( new Iter . MapFABuilder ( maxNodes ) , left . transitionIterator ( ) , right . transitionIterator ( ) ) ;
3026}
3127
3228/**
@@ -41,14 +37,14 @@ export function getIntersectionIterator<L, R>(
4137 *
4238 * @param left
4339 * @param right
44- * @param options
40+ * @param maxNodes
4541 */
4642export function isDisjointWith < L , R > (
4743 left : TransitionIterable < L > ,
4844 right : TransitionIterable < R > ,
49- options ?: Readonly < FACreationOptions >
45+ maxNodes : number = 10_000
5046) : boolean {
51- const iter = getIntersectionIterator ( left , right , options ) ;
47+ const iter = getIntersectionIterator ( left , right , maxNodes ) ;
5248
5349 return ! Iter . canReachFinal ( Iter . mapOut ( iter , n => n . keys ( ) ) ) ;
5450}
@@ -65,14 +61,14 @@ export function isDisjointWith<L, R>(
6561 *
6662 * @param left
6763 * @param right
68- * @param options
64+ * @param maxNodes
6965 */
7066export function getIntersectionWordSets < L , R > (
7167 left : TransitionIterable < L > ,
7268 right : TransitionIterable < R > ,
73- options ?: Readonly < FACreationOptions >
69+ maxNodes : number = 10_000
7470) : Iterable < WordSet > {
75- const iter = getIntersectionIterator ( left , right , options ) ;
71+ const iter = getIntersectionIterator ( left , right , maxNodes ) ;
7672
7773 return Iter . iterateWordSets ( iter ) ;
7874}
@@ -88,12 +84,12 @@ export function getIntersectionWordSets<L, R>(
8884 *
8985 * @param left
9086 * @param right
91- * @param options
87+ * @param maxNodes
9288 */
9389export function getIntersectionWords < L , R > (
9490 left : TransitionIterable < L > ,
9591 right : TransitionIterable < R > ,
96- options ?: Readonly < FACreationOptions >
92+ maxNodes : number = 10_000
9793) : Iterable < Word > {
98- return wordSetsToWords ( getIntersectionWordSets ( left , right , options ) ) ;
94+ return wordSetsToWords ( getIntersectionWordSets ( left , right , maxNodes ) ) ;
9995}
0 commit comments