From 6ae38189cf87b5a5836b475b6980747aae2c7abb Mon Sep 17 00:00:00 2001 From: Humza Shahid Date: Mon, 6 Oct 2025 07:53:05 +0100 Subject: [PATCH] previously, dtran was a {states: int list, transitions: set} record, but because the states are the exact same as the information in dstates (at same position too), we changed dtran to contain only the transitions --- fcore/search-list/dfa-gen.sml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/fcore/search-list/dfa-gen.sml b/fcore/search-list/dfa-gen.sml index e22c9c0..c6b5316 100644 --- a/fcore/search-list/dfa-gen.sml +++ b/fcore/search-list/dfa-gen.sml @@ -395,7 +395,7 @@ struct SOME (pos, #transitions record) end - type dtran = {states: int list, transitions: int list Set.set} + type dtran = int list Set.set fun convertChar (char, regex, dstates, dtran: dtran vector, curStates, curStatesIdx) = @@ -427,21 +427,17 @@ struct * so we append to dtran instead *) let val transitions = Set.insertOrReplace (char, u, Set.LEAF) - val record = - {states = curStates, transitions = transitions} in - Vector.concat [dtran, Vector.fromList [record]] + Vector.concat [dtran, Vector.fromList [transitions]] end else (* corresponding state idx does exist in dtran, so we update it *) let - val {states, transitions} = - Vector.sub (dtran, curStatesIdx) + val transitions = Vector.sub (dtran, curStatesIdx) val transitions = Set.insertOrReplace (char, u, transitions) - val record = {states = states, transitions = transitions} in - Vector.update (dtran, curStatesIdx, record) + Vector.update (dtran, curStatesIdx, transitions) end in convertChar