Skip to content

Commit 7440f28

Browse files
Create Test and Fix error due to no UFManager
1 parent 5e13202 commit 7440f28

File tree

4 files changed

+91
-3
lines changed

4 files changed

+91
-3
lines changed

src/org/sosy_lab/java_smt/solvers/stp/StpFormulaManager.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,13 @@ public final class StpFormulaManager
3030
@SuppressWarnings("checkstyle:parameternumber")
3131
protected StpFormulaManager(
3232
StpFormulaCreator pFormulaCreator,
33+
StpUFManager pUFManager,
3334
StpBooleanFormulaManager pBooleanManager,
3435
@Nullable StpBitvectorFormulaManager pBitvectorManager,
3536
@Nullable StpArrayFormulaManager pArrayManager) {
3637
super(
3738
pFormulaCreator,
38-
null,
39+
pUFManager,
3940
pBooleanManager,
4041
null,
4142
null,

src/org/sosy_lab/java_smt/solvers/stp/StpSolverContext.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,18 @@ public static StpSolverContext create(
8181

8282
//use the FormulaCreator object to create FormulaManager object for all supported Theories
8383
StpBooleanFormulaManager booleanFrmMgr = new StpBooleanFormulaManager(formulaCreator);
84+
StpUFManager functionFrmMgr = new StpUFManager(formulaCreator);
8485
StpArrayFormulaManager arrayFrmMgr = new StpArrayFormulaManager(formulaCreator);
8586
StpBitvectorFormulaManager bitvectorFrmMgr = new StpBitvectorFormulaManager(formulaCreator);
8687

87-
System.out.println("JUST right before");
8888
//Create the main FormulaManager to manage all supported Formula types
8989
StpFormulaManager formulaMgr =
90-
new StpFormulaManager(formulaCreator, booleanFrmMgr, bitvectorFrmMgr, arrayFrmMgr);
90+
new StpFormulaManager(
91+
formulaCreator,
92+
functionFrmMgr,
93+
booleanFrmMgr,
94+
bitvectorFrmMgr,
95+
arrayFrmMgr);
9196

9297
//Create the SolverContext with the FormulaCreator and main FormulaManager Objects
9398
return new StpSolverContext(formulaMgr, formulaCreator, logger);
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/*
2+
* JavaSMT is an API wrapper for a collection of SMT solvers.
3+
* This file is part of JavaSMT.
4+
*
5+
* Copyright (C) 2007-2019 Dirk Beyer
6+
* All rights reserved.
7+
*
8+
* Licensed under the Apache License, Version 2.0 (the "License");
9+
* you may not use this file except in compliance with the License.
10+
* You may obtain a copy of the License at
11+
*
12+
* http://www.apache.org/licenses/LICENSE-2.0
13+
*
14+
* Unless required by applicable law or agreed to in writing, software
15+
* distributed under the License is distributed on an "AS IS" BASIS,
16+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17+
* See the License for the specific language governing permissions and
18+
* limitations under the License.
19+
*/
20+
package org.sosy_lab.java_smt.solvers.stp;
21+
22+
import org.junit.Test;
23+
import org.sosy_lab.common.ShutdownNotifier;
24+
import org.sosy_lab.common.configuration.Configuration;
25+
import org.sosy_lab.common.configuration.InvalidConfigurationException;
26+
import org.sosy_lab.common.log.BasicLogManager;
27+
import org.sosy_lab.common.log.LogManager;
28+
import org.sosy_lab.java_smt.SolverContextFactory;
29+
import org.sosy_lab.java_smt.SolverContextFactory.Solvers;
30+
import org.sosy_lab.java_smt.api.SolverContext;
31+
32+
public class StpSolverTest {
33+
34+
@Test
35+
public void testSolverContextClass() throws InvalidConfigurationException {
36+
37+
Configuration config = Configuration.defaultConfiguration();
38+
LogManager logger = BasicLogManager.create(config);
39+
ShutdownNotifier notifier = ShutdownNotifier.createDummy();
40+
41+
Solvers solver = Solvers.STP;
42+
43+
SolverContext context =
44+
SolverContextFactory.createSolverContext(config, logger, notifier, solver);
45+
46+
System.out.println(context.getSolverName() + " ::: " + context.getVersion());
47+
48+
context.close();
49+
50+
}
51+
52+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* JavaSMT is an API wrapper for a collection of SMT solvers.
3+
* This file is part of JavaSMT.
4+
*
5+
* Copyright (C) 2007-2019 Dirk Beyer
6+
* All rights reserved.
7+
*
8+
* Licensed under the Apache License, Version 2.0 (the "License");
9+
* you may not use this file except in compliance with the License.
10+
* You may obtain a copy of the License at
11+
*
12+
* http://www.apache.org/licenses/LICENSE-2.0
13+
*
14+
* Unless required by applicable law or agreed to in writing, software
15+
* distributed under the License is distributed on an "AS IS" BASIS,
16+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17+
* See the License for the specific language governing permissions and
18+
* limitations under the License.
19+
*/
20+
package org.sosy_lab.java_smt.solvers.stp;
21+
22+
import org.sosy_lab.java_smt.basicimpl.AbstractUFManager;
23+
24+
class StpUFManager extends AbstractUFManager<Long, Long, Long, Long> {
25+
26+
protected StpUFManager(StpFormulaCreator pCreator) {
27+
super(pCreator);
28+
}
29+
30+
}

0 commit comments

Comments
 (0)