aboutsummaryrefslogtreecommitdiffstats
path: root/Framework/hu.bme.mit.inf.dslreasoner.logic.model/src/hu/bme/mit/inf/dslreasoner/logic/model/builder/LogicSolver.xtend
blob: 2e3d57cfa1f465d6c42b3315087c97a5ce5f74d1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package hu.bme.mit.inf.dslreasoner.logic.model.builder

import hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.LogicProblem
import hu.bme.mit.inf.dslreasoner.logic.model.logicresult.LogicResult
import hu.bme.mit.inf.dslreasoner.logic.model.logicresult.ModelResult
import hu.bme.mit.inf.dslreasoner.workspace.ReasonerWorkspace

abstract class LogicReasoner {
	def abstract LogicResult solve(
		LogicProblem problem,
		LogicSolverConfiguration configuration,
		ReasonerWorkspace workspace) throws LogicReasonerException
	def abstract LogicModelInterpretation getInterpretation(ModelResult modelResult)
}

public class LogicReasonerException extends Exception {
	new(String message, Exception cause) { super(message,cause) }
	new(Exception cause) { super("The reasoner has failed",cause)}
	new(String message) { super(message) }
}

abstract class LogicSolverConfiguration {
	public static val Unlimited = -1;
	public static val String UndefinedPath = null
	
	/** The URI string to the independent solver application */
	public String solverPath = UndefinedPath
	/** Max runtime limit in seconds. */
	public int runtimeLimit = Unlimited
	/** Max runtime limit in seconds. */
	public int memoryLimit = Unlimited
	
	public var TypeScopes typeScopes = new TypeScopes;
	public var SolutionScope solutionScope = new SolutionScope
}

public class TypeScopes{
	public static val Unlimited = -1;
	public var maxIntScope = Unlimited
	public var minNewElements = 0
	public var maxNewElements = Unlimited
}

public class SolutionScope{
	public static val Unlimited = -1;
	public var numberOfRequiredSolution = 1
}