diff options
Diffstat (limited to 'Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src')
3 files changed, 74 insertions, 0 deletions
diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/formulacanonization/CanonisedFormulae.xtend b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/formulacanonization/CanonisedFormulae.xtend new file mode 100644 index 00000000..e511a961 --- /dev/null +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/formulacanonization/CanonisedFormulae.xtend | |||
@@ -0,0 +1,17 @@ | |||
1 | package hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.formulacanonization | ||
2 | |||
3 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Assertion | ||
4 | import java.util.Map | ||
5 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.ConstantDefinition | ||
6 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.FunctionDefinition | ||
7 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.RelationDefinition | ||
8 | import org.eclipse.xtend.lib.annotations.Data | ||
9 | |||
10 | @Data | ||
11 | class CanonisedFormulae { | ||
12 | CharSequence viatraCode | ||
13 | Map<Assertion,String> assertion2ConstraintPattern | ||
14 | Map<ConstantDefinition,String> constant2ValuePattern | ||
15 | Map<RelationDefinition,String> relation2ValuePattern | ||
16 | Map<FunctionDefinition,String> function2ValuePattern | ||
17 | } \ No newline at end of file | ||
diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/formulacanonization/FormulaCanoniser.xtend b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/formulacanonization/FormulaCanoniser.xtend new file mode 100644 index 00000000..0af0b36a --- /dev/null +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/formulacanonization/FormulaCanoniser.xtend | |||
@@ -0,0 +1,21 @@ | |||
1 | package hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.formulacanonization | ||
2 | |||
3 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Assertion | ||
4 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.ConstantDefinition | ||
5 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.FunctionDefinition | ||
6 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.RelationDefinition | ||
7 | import java.util.List | ||
8 | |||
9 | /** | ||
10 | * Translates a set of assertions and definitions to viatra patterns. | ||
11 | */ | ||
12 | class FormulaCanoniser { | ||
13 | def canonise( | ||
14 | List<Assertion> assertions, | ||
15 | List<RelationDefinition> relations, | ||
16 | List<ConstantDefinition> constants, | ||
17 | List<FunctionDefinition> functions) | ||
18 | { | ||
19 | |||
20 | } | ||
21 | } \ No newline at end of file | ||
diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/formulacanonization/FormulaRewriter.xtend b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/formulacanonization/FormulaRewriter.xtend new file mode 100644 index 00000000..af34a5a7 --- /dev/null +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/formulacanonization/FormulaRewriter.xtend | |||
@@ -0,0 +1,36 @@ | |||
1 | package hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.formulacanonization | ||
2 | |||
3 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Term | ||
4 | import org.eclipse.emf.ecore.util.EcoreUtil | ||
5 | import java.util.LinkedList | ||
6 | import java.util.List | ||
7 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Variable | ||
8 | import org.eclipse.xtend.lib.annotations.Data | ||
9 | |||
10 | |||
11 | @Data | ||
12 | class Clause { | ||
13 | List<Term> atomicExpressions | ||
14 | } | ||
15 | |||
16 | /** | ||
17 | * Rewrites a term to a first order CNF, where F | ||
18 | * <p><table> | ||
19 | * <tr><th>Symbol</th><th>-></th><th>expression</th></tr> | ||
20 | * <tr><td>F</td><td>-></td><td>Quantified (∨ Quantified)*</td></tr> | ||
21 | * <tr><td>Quantified</td><td>-></td><td>(∃x Quantified) | Clause</td></tr> | ||
22 | * <tr><td>Clause</td><td>-></td><td> Atomic (∧ Atomic)* </td></tr> | ||
23 | * <tr><td>Atomic</td><td>-></td><td> Type(x) | Path (x,y) | x==y | x!=y | F | ¬F </td></tr> | ||
24 | * </table></p> | ||
25 | */ | ||
26 | class FormulaRewriter { | ||
27 | public def rewriteExpression(Term expression) { | ||
28 | val termToRewrite = EcoreUtil.copy(expression | ||
29 | ) | ||
30 | } | ||
31 | |||
32 | public def internalRewriteExpression(Term expression) { | ||
33 | val List<Variable> quantifiedVariables = new LinkedList | ||
34 | val List<Clause> clauses = new LinkedList | ||
35 | } | ||
36 | } \ No newline at end of file | ||