Skip to content

Commit 5ed3eff

Browse files
committed
added phi (redundant) state in ResultantDfa for catering empty transitions
1 parent 27dbaa2 commit 5ed3eff

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/features/components/nfaToDfa/ResultantDfa.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,9 @@ export const ResultantDfa = (props: ResultantDfaProps) => {
313313
?.join(", ") ?? ""
314314
: ""
315315
: row.a;
316+
317+
if (a === "") a = "Φ";
318+
316319
console.log("a: ", a);
317320
// insert a value in availableStates object if it is not already present and set isAvailable to true
318321
if (a !== "" && !availableStates.find((as) => as.name === a)) {
@@ -351,6 +354,10 @@ export const ResultantDfa = (props: ResultantDfaProps) => {
351354
?.join(", ") ?? ""
352355
: ""
353356
: row.b;
357+
358+
if (index % numberOfColumns === numberOfColumns - 1 && b === "")
359+
b = "Φ";
360+
354361
console.log("b: ", b);
355362
// insert b value in availableStates object if it is not already present and set isAvailable to true
356363
if (b !== "" && !availableStates.find((as) => as.name === b)) {

0 commit comments

Comments
 (0)