Commit 0632140f authored by Sudeep Kanav's avatar Sudeep Kanav
Browse files

using stream instread of parallel stream for mapping a list

parent b51b05f0
......@@ -23,7 +23,7 @@ import static org.fortiss.af3.tools.nusmv.model.NuSMVModelFactory.addLocalVariab
import static org.fortiss.af3.tools.nusmv.model.NuSMVModelFactory.createInvar;
import static org.fortiss.af3.tools.nusmv.model.NuSMVModelFactory.createModuleType;
import static org.fortiss.tooling.base.utils.SystemUtils.isWindowsOperatingSystem;
import static org.fortiss.tooling.common.util.LambdaUtils.mapInOut;
import static org.fortiss.tooling.common.util.LambdaUtils.mapOut;
import static org.fortiss.tooling.kernel.utils.LoggingUtils.error;
import static org.fortiss.tooling.kernel.utils.LoggingUtils.info;
......@@ -69,7 +69,7 @@ import org.fortiss.af3.tools.nusmv.textgen.NuSMVTextGenerator;
* @author ratiu
* @author $Author: ratiu $
* @version $Rev: 1270 $
* @ConQAT.Rating YELLOW Hash: ADADEC5158494810D6174B9756B112A9
* @ConQAT.Rating YELLOW Hash: 7DAE3E622AA25B577595693293ECA3F4
*/
public class NuSMVRunner extends ToolRunnerBase<NuSMVFile, NuSMVResult> {
......@@ -203,17 +203,18 @@ public class NuSMVRunner extends ToolRunnerBase<NuSMVFile, NuSMVResult> {
/** Creates a NuSMVFile object that has an instance of the module in the returned LocalVariable. */
protected static Pair<NuSMVFile, LocalVariable> createCompleteNuSMVFileForModule(Module m) {
NuSMVFile f = NuSMVModelFactory.createNuSMVFile(m.getName());
// We use the module directly as main-module so we don't have to adjust the formulas of the
// We use the module directly as main-module so we don't have to adjust the formulas of
// the
// specs to address the correct variables. Still it would be easy as NuSMV provides the
// "<spec> IN <var>" construct for property checking.
Module mainModule = NuSMVModelFactory.createMainModule(f);
Function<LocalVariable, IExpressionTerm> fun =
p -> addLocalVariable(mainModule, p.getName(), p.getType());
List<IExpressionTerm> actualParams =
(List<IExpressionTerm>)mapInOut(m.getParameters(), fun, ArrayList::new);
(List<IExpressionTerm>)mapOut(m.getParameters().stream(), fun, ArrayList::new);
patchForFakeValue(mainModule);
LocalVariable moduleInstance =
addLocalVariable(mainModule, "module", createModuleType(m, actualParams));
f.setMainModule(mainModule);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment