fixed complement

This commit is contained in:
Tocuro 2024-01-09 17:00:16 +01:00
parent 0d47de5c44
commit 4422270452
3 changed files with 44 additions and 44 deletions

68
.idea/workspace.xml generated
View file

@ -4,7 +4,12 @@
<option name="autoReloadType" value="SELECTIVE" /> <option name="autoReloadType" value="SELECTIVE" />
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="f5e08808-a5af-4c89-a1ee-21b3bcb9ae3e" name="Changes" comment="concat GEHT" /> <list default="true" id="f5e08808-a5af-4c89-a1ee-21b3bcb9ae3e" name="Changes" comment="concat GEHT">
<change beforePath="$PROJECT_DIR$/.idea/shelf/Uncommitted_changes_before_Update_at_08_01_2024_18_35__Changes_.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/shelf/Uncommitted_changes_before_Update_at_08_01_2024_18_35__Changes_.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/ab1/impl/GRUPPE/NFAImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/ab1/impl/GRUPPE/NFAImpl.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/target/classes/ab1/impl/GRUPPE/NFAImpl.class" beforeDir="false" />
</list>
<list id="39d4ccb3-eae9-4ed4-996a-5a13f44678fa" name="Changes by carol" comment="" /> <list id="39d4ccb3-eae9-4ed4-996a-5a13f44678fa" name="Changes by carol" comment="" />
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -46,26 +51,26 @@
<option name="hideEmptyMiddlePackages" value="true" /> <option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" /> <option name="showLibraryContents" value="true" />
</component> </component>
<component name="PropertiesComponent">{ <component name="PropertiesComponent"><![CDATA[{
&quot;keyToString&quot;: { "keyToString": {
&quot;RunOnceActivity.OpenProjectViewOnStart&quot;: &quot;true&quot;, "RunOnceActivity.OpenProjectViewOnStart": "true",
&quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;, "RunOnceActivity.ShowReadmeOnStart": "true",
&quot;WebServerToolWindowFactoryState&quot;: &quot;false&quot;, "WebServerToolWindowFactoryState": "false",
&quot;full.screen.before.presentation.mode&quot;: &quot;false&quot;, "full.screen.before.presentation.mode": "false",
&quot;git-widget-placeholder&quot;: &quot;5-top-skill-issue-raphael&quot;, "git-widget-placeholder": "main",
&quot;ignore.virus.scanning.warn.message&quot;: &quot;true&quot;, "ignore.virus.scanning.warn.message": "true",
&quot;node.js.detected.package.eslint&quot;: &quot;true&quot;, "node.js.detected.package.eslint": "true",
&quot;node.js.detected.package.tslint&quot;: &quot;true&quot;, "node.js.detected.package.tslint": "true",
&quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;, "node.js.selected.package.eslint": "(autodetect)",
&quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;, "node.js.selected.package.tslint": "(autodetect)",
&quot;nodejs_package_manager_path&quot;: &quot;npm&quot;, "nodejs_package_manager_path": "npm",
&quot;project.structure.last.edited&quot;: &quot;Project&quot;, "project.structure.last.edited": "Project",
&quot;project.structure.proportion&quot;: &quot;0.0&quot;, "project.structure.proportion": "0.0",
&quot;project.structure.side.proportion&quot;: &quot;0.0&quot;, "project.structure.side.proportion": "0.0",
&quot;settings.editor.selected.configurable&quot;: &quot;preferences.lookFeel&quot;, "settings.editor.selected.configurable": "preferences.lookFeel",
&quot;vue.rearranger.settings.migration&quot;: &quot;true&quot; "vue.rearranger.settings.migration": "true"
} }
}</component> }]]></component>
<component name="RunManager" selected="JUnit.ab1 in ETI_Abgabe"> <component name="RunManager" selected="JUnit.ab1 in ETI_Abgabe">
<configuration name="ComplexTests.complement1Test" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true"> <configuration name="ComplexTests.complement1Test" type="JUnit" factoryName="JUnit" temporary="true" nameIsGenerated="true">
<module name="ETI_Abgabe" /> <module name="ETI_Abgabe" />
@ -242,6 +247,17 @@
<component name="TypeScriptGeneratedFilesManager"> <component name="TypeScriptGeneratedFilesManager">
<option name="version" value="3" /> <option name="version" value="3" />
</component> </component>
<component name="Vcs.Log.Tabs.Properties">
<option name="TAB_STATES">
<map>
<entry key="MAIN">
<value>
<State />
</value>
</entry>
</map>
</option>
</component>
<component name="VcsManagerConfiguration"> <component name="VcsManagerConfiguration">
<MESSAGE value="progress of 7/1" /> <MESSAGE value="progress of 7/1" />
<MESSAGE value="changed a bit" /> <MESSAGE value="changed a bit" />
@ -253,10 +269,14 @@
<component name="XDebuggerManager"> <component name="XDebuggerManager">
<breakpoint-manager> <breakpoint-manager>
<breakpoints> <breakpoints>
<line-breakpoint enabled="true" type="java-line"> <line-breakpoint enabled="true" type="java-method">
<url>file://$PROJECT_DIR$/src/test/java/ab1/tests/ComplexTests.java</url> <url>file://$PROJECT_DIR$/src/main/java/ab1/impl/GRUPPE/NFAImpl.java</url>
<line>15</line> <line>336</line>
<option name="timeStamp" value="12" /> <properties class="ab1.impl.GRUPPE.NFAImpl" method="complement">
<option name="EMULATED" value="true" />
<option name="WATCH_EXIT" value="false" />
</properties>
<option name="timeStamp" value="13" />
</line-breakpoint> </line-breakpoint>
</breakpoints> </breakpoints>
</breakpoint-manager> </breakpoint-manager>

View file

@ -362,26 +362,6 @@ public class NFAImpl implements NFA {
fakeNFA.acceptingStates.clear(); fakeNFA.acceptingStates.clear();
fakeNFA.addAllAcceptingStates(newAcceptingState); fakeNFA.addAllAcceptingStates(newAcceptingState);
Set<Character> originalAlphabet = new HashSet<>(fakeNFA.alphabet);
fakeNFA.alphabet.clear();
Set<Character> newAlphabet = new HashSet<>();
for (char ch = 'a'; ch <= 'z'; ch++) {
if (!originalAlphabet.contains(ch)) {
newAlphabet.add(ch);
}
}
for (Transition transition : fakeNFA.transitions) {
for (Character letter : newAlphabet) {
fakeNFA.addTransition(new Transition(transition.fromState(), letter, transition.toState()));
}
}
fakeNFA.alphabet = newAlphabet;
fakeNFA.finalizeAutomaton(); fakeNFA.finalizeAutomaton();
return fakeNFA; return fakeNFA;