diff options
Diffstat (limited to 'Tests/ca.mcgill.ecse.dslreasoner.standalone.test/outputs/fam/debug')
4 files changed, 17721 insertions, 73 deletions
diff --git a/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/outputs/fam/debug/errors.txt b/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/outputs/fam/debug/errors.txt index 28b10066..d66c8df1 100644 --- a/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/outputs/fam/debug/errors.txt +++ b/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/outputs/fam/debug/errors.txt | |||
@@ -445,4 +445,109 @@ Error occured (UnsupportedOperationException): Can not transform pattern "ca.mcg | |||
445 | hu.bme.mit.inf.dslreasoner.application.execution.ScriptExecutor.execute(ScriptExecutor.java:339) | 445 | hu.bme.mit.inf.dslreasoner.application.execution.ScriptExecutor.execute(ScriptExecutor.java:339) |
446 | hu.bme.mit.inf.dslreasoner.application.execution.ScriptExecutor.executeScript(ScriptExecutor.java:111) | 446 | hu.bme.mit.inf.dslreasoner.application.execution.ScriptExecutor.executeScript(ScriptExecutor.java:111) |
447 | hu.bme.mit.inf.dslreasoner.application.execution.ScriptExecutor$1.run(ScriptExecutor.java:73) | 447 | hu.bme.mit.inf.dslreasoner.application.execution.ScriptExecutor$1.run(ScriptExecutor.java:73) |
448 | org.eclipse.core.internal.jobs.Worker.run(Worker.java:56) \ No newline at end of file | 448 | org.eclipse.core.internal.jobs.Worker.run(Worker.java:56)Error occured (NoSuchElementException): Cannot find entry with FQN ca.mcgill.ecse.dslreasoner.standalone.test.fam.queries.model |
449 | org.eclipse.viatra.query.runtime.registry.impl.GlobalRegistryView.getEntry(GlobalRegistryView.java:56) | ||
450 | org.eclipse.viatra.addon.querybasedfeatures.runtime.QueryBasedFeatureSettingDelegateFactory.findQuerySpecification(QueryBasedFeatureSettingDelegateFactory.java:152) | ||
451 | org.eclipse.viatra.addon.querybasedfeatures.runtime.QueryBasedFeatureSettingDelegateFactory.createSettingDelegate(QueryBasedFeatureSettingDelegateFactory.java:113) | ||
452 | org.eclipse.emf.ecore.impl.EStructuralFeatureImpl.getSettingDelegate(EStructuralFeatureImpl.java:854) | ||
453 | ca.mcgill.ecse.dslreasoner.standalone.test.fam.impl.FunctionalElementImpl.<init>(FunctionalElementImpl.java:57) | ||
454 | ca.mcgill.ecse.dslreasoner.standalone.test.fam.impl.FunctionImpl.<init>(FunctionImpl.java:64) | ||
455 | ca.mcgill.ecse.dslreasoner.standalone.test.fam.impl.famFactoryImpl.createFunction(famFactoryImpl.java:125) | ||
456 | ca.mcgill.ecse.dslreasoner.standalone.test.fam.impl.famFactoryImpl.create(famFactoryImpl.java:68) | ||
457 | hu.bme.mit.inf.dslreasoner.logic2ecore.Logic2Ecore.transformInterpretation(Logic2Ecore.java:75) | ||
458 | hu.bme.mit.inf.dslreasoner.application.execution.GenerationTaskExecutor.executeGenerationTask(GenerationTaskExecutor.java:359) | ||
459 | hu.bme.mit.inf.dslreasoner.application.execution.ScriptExecutor._execute(ScriptExecutor.java:129) | ||
460 | hu.bme.mit.inf.dslreasoner.application.execution.ScriptExecutor.execute(ScriptExecutor.java:338) | ||
461 | hu.bme.mit.inf.dslreasoner.application.execution.ScriptExecutor.executeScript(ScriptExecutor.java:110) | ||
462 | hu.bme.mit.inf.dslreasoner.application.execution.ScriptExecutor$1.run(ScriptExecutor.java:73) | ||
463 | org.eclipse.core.internal.jobs.Worker.run(Worker.java:60)Error occured (NoSuchElementException): Cannot find entry with FQN ca.mcgill.ecse.dslreasoner.standalone.test.fam.queries.model | ||
464 | org.eclipse.viatra.query.runtime.registry.impl.GlobalRegistryView.getEntry(GlobalRegistryView.java:56) | ||
465 | org.eclipse.viatra.addon.querybasedfeatures.runtime.QueryBasedFeatureSettingDelegateFactory.findQuerySpecification(QueryBasedFeatureSettingDelegateFactory.java:152) | ||
466 | org.eclipse.viatra.addon.querybasedfeatures.runtime.QueryBasedFeatureSettingDelegateFactory.createSettingDelegate(QueryBasedFeatureSettingDelegateFactory.java:113) | ||
467 | org.eclipse.emf.ecore.impl.EStructuralFeatureImpl.getSettingDelegate(EStructuralFeatureImpl.java:854) | ||
468 | ca.mcgill.ecse.dslreasoner.standalone.test.fam.impl.FunctionalElementImpl.<init>(FunctionalElementImpl.java:57) | ||
469 | ca.mcgill.ecse.dslreasoner.standalone.test.fam.impl.FunctionImpl.<init>(FunctionImpl.java:64) | ||
470 | ca.mcgill.ecse.dslreasoner.standalone.test.fam.impl.famFactoryImpl.createFunction(famFactoryImpl.java:125) | ||
471 | ca.mcgill.ecse.dslreasoner.standalone.test.fam.impl.famFactoryImpl.create(famFactoryImpl.java:68) | ||
472 | hu.bme.mit.inf.dslreasoner.logic2ecore.Logic2Ecore.transformInterpretation(Logic2Ecore.java:75) | ||
473 | hu.bme.mit.inf.dslreasoner.application.execution.GenerationTaskExecutor.executeGenerationTask(GenerationTaskExecutor.java:359) | ||
474 | hu.bme.mit.inf.dslreasoner.application.execution.ScriptExecutor._execute(ScriptExecutor.java:129) | ||
475 | hu.bme.mit.inf.dslreasoner.application.execution.ScriptExecutor.execute(ScriptExecutor.java:338) | ||
476 | hu.bme.mit.inf.dslreasoner.application.execution.ScriptExecutor.executeScript(ScriptExecutor.java:110) | ||
477 | hu.bme.mit.inf.dslreasoner.application.execution.ScriptExecutor$1.run(ScriptExecutor.java:73) | ||
478 | org.eclipse.core.internal.jobs.Worker.run(Worker.java:60)Error occured (NoSuchElementException): Cannot find entry with FQN ca.mcgill.ecse.dslreasoner.standalone.test.fam.queries.model | ||
479 | org.eclipse.viatra.query.runtime.registry.impl.GlobalRegistryView.getEntry(GlobalRegistryView.java:56) | ||
480 | org.eclipse.viatra.addon.querybasedfeatures.runtime.QueryBasedFeatureSettingDelegateFactory.findQuerySpecification(QueryBasedFeatureSettingDelegateFactory.java:152) | ||
481 | org.eclipse.viatra.addon.querybasedfeatures.runtime.QueryBasedFeatureSettingDelegateFactory.createSettingDelegate(QueryBasedFeatureSettingDelegateFactory.java:113) | ||
482 | org.eclipse.emf.ecore.impl.EStructuralFeatureImpl.getSettingDelegate(EStructuralFeatureImpl.java:854) | ||
483 | ca.mcgill.ecse.dslreasoner.standalone.test.fam.impl.FunctionalElementImpl.<init>(FunctionalElementImpl.java:57) | ||
484 | ca.mcgill.ecse.dslreasoner.standalone.test.fam.impl.FunctionImpl.<init>(FunctionImpl.java:64) | ||
485 | ca.mcgill.ecse.dslreasoner.standalone.test.fam.impl.famFactoryImpl.createFunction(famFactoryImpl.java:125) | ||
486 | ca.mcgill.ecse.dslreasoner.standalone.test.fam.impl.famFactoryImpl.create(famFactoryImpl.java:68) | ||
487 | hu.bme.mit.inf.dslreasoner.logic2ecore.Logic2Ecore.transformInterpretation(Logic2Ecore.java:75) | ||
488 | hu.bme.mit.inf.dslreasoner.application.execution.GenerationTaskExecutor.executeGenerationTask(GenerationTaskExecutor.java:359) | ||
489 | hu.bme.mit.inf.dslreasoner.application.execution.ScriptExecutor._execute(ScriptExecutor.java:129) | ||
490 | hu.bme.mit.inf.dslreasoner.application.execution.ScriptExecutor.execute(ScriptExecutor.java:338) | ||
491 | hu.bme.mit.inf.dslreasoner.application.execution.ScriptExecutor.executeScript(ScriptExecutor.java:110) | ||
492 | hu.bme.mit.inf.dslreasoner.application.execution.ScriptExecutor$1.run(ScriptExecutor.java:73) | ||
493 | org.eclipse.core.internal.jobs.Worker.run(Worker.java:60)Error occured (NoSuchElementException): Cannot find entry with FQN ca.mcgill.ecse.dslreasoner.standalone.test.fam.queries.model | ||
494 | org.eclipse.viatra.query.runtime.registry.impl.GlobalRegistryView.getEntry(GlobalRegistryView.java:56) | ||
495 | org.eclipse.viatra.addon.querybasedfeatures.runtime.QueryBasedFeatureSettingDelegateFactory.findQuerySpecification(QueryBasedFeatureSettingDelegateFactory.java:152) | ||
496 | org.eclipse.viatra.addon.querybasedfeatures.runtime.QueryBasedFeatureSettingDelegateFactory.createSettingDelegate(QueryBasedFeatureSettingDelegateFactory.java:113) | ||
497 | org.eclipse.emf.ecore.impl.EStructuralFeatureImpl.getSettingDelegate(EStructuralFeatureImpl.java:854) | ||
498 | ca.mcgill.ecse.dslreasoner.standalone.test.fam.impl.FunctionalElementImpl.<init>(FunctionalElementImpl.java:57) | ||
499 | ca.mcgill.ecse.dslreasoner.standalone.test.fam.impl.FunctionImpl.<init>(FunctionImpl.java:64) | ||
500 | ca.mcgill.ecse.dslreasoner.standalone.test.fam.impl.famFactoryImpl.createFunction(famFactoryImpl.java:125) | ||
501 | ca.mcgill.ecse.dslreasoner.standalone.test.fam.impl.famFactoryImpl.create(famFactoryImpl.java:68) | ||
502 | hu.bme.mit.inf.dslreasoner.logic2ecore.Logic2Ecore.transformInterpretation(Logic2Ecore.java:75) | ||
503 | hu.bme.mit.inf.dslreasoner.application.execution.GenerationTaskExecutor.executeGenerationTask(GenerationTaskExecutor.java:359) | ||
504 | hu.bme.mit.inf.dslreasoner.application.execution.ScriptExecutor._execute(ScriptExecutor.java:129) | ||
505 | hu.bme.mit.inf.dslreasoner.application.execution.ScriptExecutor.execute(ScriptExecutor.java:338) | ||
506 | hu.bme.mit.inf.dslreasoner.application.execution.ScriptExecutor.executeScript(ScriptExecutor.java:110) | ||
507 | hu.bme.mit.inf.dslreasoner.application.execution.ScriptExecutor$1.run(ScriptExecutor.java:73) | ||
508 | org.eclipse.core.internal.jobs.Worker.run(Worker.java:60)Error occured (NoSuchElementException): Cannot find entry with FQN ca.mcgill.ecse.dslreasoner.standalone.test.fam.queries.model | ||
509 | org.eclipse.viatra.query.runtime.registry.impl.GlobalRegistryView.getEntry(GlobalRegistryView.java:56) | ||
510 | org.eclipse.viatra.addon.querybasedfeatures.runtime.QueryBasedFeatureSettingDelegateFactory.findQuerySpecification(QueryBasedFeatureSettingDelegateFactory.java:152) | ||
511 | org.eclipse.viatra.addon.querybasedfeatures.runtime.QueryBasedFeatureSettingDelegateFactory.createSettingDelegate(QueryBasedFeatureSettingDelegateFactory.java:113) | ||
512 | org.eclipse.emf.ecore.impl.EStructuralFeatureImpl.getSettingDelegate(EStructuralFeatureImpl.java:854) | ||
513 | ca.mcgill.ecse.dslreasoner.standalone.test.fam.impl.FunctionalElementImpl.<init>(FunctionalElementImpl.java:57) | ||
514 | ca.mcgill.ecse.dslreasoner.standalone.test.fam.impl.FunctionImpl.<init>(FunctionImpl.java:64) | ||
515 | ca.mcgill.ecse.dslreasoner.standalone.test.fam.impl.famFactoryImpl.createFunction(famFactoryImpl.java:125) | ||
516 | ca.mcgill.ecse.dslreasoner.standalone.test.fam.impl.famFactoryImpl.create(famFactoryImpl.java:68) | ||
517 | hu.bme.mit.inf.dslreasoner.logic2ecore.Logic2Ecore.transformInterpretation(Logic2Ecore.java:75) | ||
518 | hu.bme.mit.inf.dslreasoner.application.execution.GenerationTaskExecutor.executeGenerationTask(GenerationTaskExecutor.java:359) | ||
519 | hu.bme.mit.inf.dslreasoner.application.execution.ScriptExecutor._execute(ScriptExecutor.java:129) | ||
520 | hu.bme.mit.inf.dslreasoner.application.execution.ScriptExecutor.execute(ScriptExecutor.java:338) | ||
521 | hu.bme.mit.inf.dslreasoner.application.execution.ScriptExecutor.executeScript(ScriptExecutor.java:110) | ||
522 | hu.bme.mit.inf.dslreasoner.application.execution.ScriptExecutor$1.run(ScriptExecutor.java:73) | ||
523 | org.eclipse.core.internal.jobs.Worker.run(Worker.java:60)Error occured (NoSuchElementException): Cannot find entry with FQN ca.mcgill.ecse.dslreasoner.standalone.test.fam.queries.model | ||
524 | org.eclipse.viatra.query.runtime.registry.impl.GlobalRegistryView.getEntry(GlobalRegistryView.java:56) | ||
525 | org.eclipse.viatra.addon.querybasedfeatures.runtime.QueryBasedFeatureSettingDelegateFactory.findQuerySpecification(QueryBasedFeatureSettingDelegateFactory.java:152) | ||
526 | org.eclipse.viatra.addon.querybasedfeatures.runtime.QueryBasedFeatureSettingDelegateFactory.createSettingDelegate(QueryBasedFeatureSettingDelegateFactory.java:113) | ||
527 | org.eclipse.emf.ecore.impl.EStructuralFeatureImpl.getSettingDelegate(EStructuralFeatureImpl.java:854) | ||
528 | ca.mcgill.ecse.dslreasoner.standalone.test.fam.impl.FunctionalElementImpl.<init>(FunctionalElementImpl.java:57) | ||
529 | ca.mcgill.ecse.dslreasoner.standalone.test.fam.impl.FunctionImpl.<init>(FunctionImpl.java:64) | ||
530 | ca.mcgill.ecse.dslreasoner.standalone.test.fam.impl.famFactoryImpl.createFunction(famFactoryImpl.java:125) | ||
531 | ca.mcgill.ecse.dslreasoner.standalone.test.fam.impl.famFactoryImpl.create(famFactoryImpl.java:68) | ||
532 | hu.bme.mit.inf.dslreasoner.logic2ecore.Logic2Ecore.transformInterpretation(Logic2Ecore.java:75) | ||
533 | hu.bme.mit.inf.dslreasoner.application.execution.GenerationTaskExecutor.executeGenerationTask(GenerationTaskExecutor.java:359) | ||
534 | hu.bme.mit.inf.dslreasoner.application.execution.ScriptExecutor._execute(ScriptExecutor.java:129) | ||
535 | hu.bme.mit.inf.dslreasoner.application.execution.ScriptExecutor.execute(ScriptExecutor.java:338) | ||
536 | hu.bme.mit.inf.dslreasoner.application.execution.ScriptExecutor.executeScript(ScriptExecutor.java:110) | ||
537 | hu.bme.mit.inf.dslreasoner.application.execution.ScriptExecutor$1.run(ScriptExecutor.java:73) | ||
538 | org.eclipse.core.internal.jobs.Worker.run(Worker.java:60)Error occured (NoSuchElementException): Cannot find entry with FQN ca.mcgill.ecse.dslreasoner.standalone.test.fam.queries.model | ||
539 | org.eclipse.viatra.query.runtime.registry.impl.GlobalRegistryView.getEntry(GlobalRegistryView.java:56) | ||
540 | org.eclipse.viatra.addon.querybasedfeatures.runtime.QueryBasedFeatureSettingDelegateFactory.findQuerySpecification(QueryBasedFeatureSettingDelegateFactory.java:152) | ||
541 | org.eclipse.viatra.addon.querybasedfeatures.runtime.QueryBasedFeatureSettingDelegateFactory.createSettingDelegate(QueryBasedFeatureSettingDelegateFactory.java:113) | ||
542 | org.eclipse.emf.ecore.impl.EStructuralFeatureImpl.getSettingDelegate(EStructuralFeatureImpl.java:854) | ||
543 | ca.mcgill.ecse.dslreasoner.standalone.test.fam.impl.FunctionalElementImpl.<init>(FunctionalElementImpl.java:57) | ||
544 | ca.mcgill.ecse.dslreasoner.standalone.test.fam.impl.FunctionImpl.<init>(FunctionImpl.java:64) | ||
545 | ca.mcgill.ecse.dslreasoner.standalone.test.fam.impl.famFactoryImpl.createFunction(famFactoryImpl.java:125) | ||
546 | ca.mcgill.ecse.dslreasoner.standalone.test.fam.impl.famFactoryImpl.create(famFactoryImpl.java:68) | ||
547 | hu.bme.mit.inf.dslreasoner.logic2ecore.Logic2Ecore.transformInterpretation(Logic2Ecore.java:75) | ||
548 | hu.bme.mit.inf.dslreasoner.application.execution.GenerationTaskExecutor.executeGenerationTask(GenerationTaskExecutor.java:359) | ||
549 | hu.bme.mit.inf.dslreasoner.application.execution.ScriptExecutor._execute(ScriptExecutor.java:129) | ||
550 | hu.bme.mit.inf.dslreasoner.application.execution.ScriptExecutor.execute(ScriptExecutor.java:338) | ||
551 | hu.bme.mit.inf.dslreasoner.application.execution.ScriptExecutor.executeScript(ScriptExecutor.java:110) | ||
552 | hu.bme.mit.inf.dslreasoner.application.execution.ScriptExecutor$1.run(ScriptExecutor.java:73) | ||
553 | org.eclipse.core.internal.jobs.Worker.run(Worker.java:60) \ No newline at end of file | ||
diff --git a/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/outputs/fam/debug/generated3valued.vql_deactivated b/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/outputs/fam/debug/generated3valued.vql_deactivated index b3223685..4ca1b4b0 100644 --- a/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/outputs/fam/debug/generated3valued.vql_deactivated +++ b/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/outputs/fam/debug/generated3valued.vql_deactivated | |||
@@ -55028,3 +55028,17614 @@ pattern refineRelation_type_attribute_Function( | |||
55028 | find mayInRelationtype_attribute_Function(problem,interpretation,from,to); | 55028 | find mayInRelationtype_attribute_Function(problem,interpretation,from,to); |
55029 | neg find mustInRelationtype_attribute_Function(problem,interpretation,from,to); | 55029 | neg find mustInRelationtype_attribute_Function(problem,interpretation,from,to); |
55030 | } | 55030 | } |
55031 | import epackage "http://www.bme.hu/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage" | ||
55032 | import epackage "http://www.bme.hu/mit/inf/dslreasoner/logic/model/problem" | ||
55033 | import epackage "http://www.bme.hu/mit/inf/dslreasoner/logic/model/language" | ||
55034 | |||
55035 | ////////// | ||
55036 | // 0. Util | ||
55037 | ////////// | ||
55038 | private pattern interpretation(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
55039 | PartialInterpretation.problem(interpretation,problem); | ||
55040 | } | ||
55041 | |||
55042 | ///////////////////////// | ||
55043 | // 0.1 Existence | ||
55044 | ///////////////////////// | ||
55045 | private pattern mustExist(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
55046 | find interpretation(problem,interpretation); | ||
55047 | LogicProblem.elements(problem,element); | ||
55048 | } or { | ||
55049 | find interpretation(problem,interpretation); | ||
55050 | PartialInterpretation.newElements(interpretation,element); | ||
55051 | } | ||
55052 | |||
55053 | private pattern mayExist(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
55054 | find mustExist(problem,interpretation,element); | ||
55055 | } or { | ||
55056 | find interpretation(problem,interpretation); | ||
55057 | neg find elementCloseWorld(element); | ||
55058 | PartialInterpretation.openWorldElements(interpretation,element); | ||
55059 | } | ||
55060 | |||
55061 | private pattern elementCloseWorld(element:DefinedElement) { | ||
55062 | PartialInterpretation.openWorldElements(i,element); | ||
55063 | PartialInterpretation.maxNewElements(i,0); | ||
55064 | } or { | ||
55065 | Scope.targetTypeInterpretation(scope,interpretation); | ||
55066 | PartialTypeInterpratation.elements(interpretation,element); | ||
55067 | Scope.maxNewElements(scope,0); | ||
55068 | } | ||
55069 | |||
55070 | //////////////////////// | ||
55071 | // 0.2 Equivalence | ||
55072 | //////////////////////// | ||
55073 | pattern mayEquivalent(problem:LogicProblem, interpretation:PartialInterpretation, a: DefinedElement, b: DefinedElement) { | ||
55074 | find mayExist(problem,interpretation,a); | ||
55075 | find mayExist(problem,interpretation,b); | ||
55076 | a == b; | ||
55077 | } | ||
55078 | |||
55079 | //////////////////////// | ||
55080 | // 0.3 Required Patterns by TypeIndexer | ||
55081 | //////////////////////// | ||
55082 | private pattern typeInterpretation(problem:LogicProblem, interpretation:PartialInterpretation, type:TypeDeclaration, typeInterpretation:PartialComplexTypeInterpretation) { | ||
55083 | find interpretation(problem,interpretation); | ||
55084 | LogicProblem.types(problem,type); | ||
55085 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
55086 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
55087 | } | ||
55088 | |||
55089 | private pattern directInstanceOf(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement, type:Type) { | ||
55090 | find interpretation(problem,interpretation); | ||
55091 | LogicProblem.types(problem,type); | ||
55092 | TypeDefinition.elements(type,element); | ||
55093 | } or { | ||
55094 | find interpretation(problem,interpretation); | ||
55095 | find typeInterpretation(problem,interpretation,type,typeInterpretation); | ||
55096 | PartialComplexTypeInterpretation.elements(typeInterpretation,element); | ||
55097 | } | ||
55098 | |||
55099 | private pattern isPrimitive(element: PrimitiveElement) { | ||
55100 | PrimitiveElement(element); | ||
55101 | } | ||
55102 | |||
55103 | ////////// | ||
55104 | // 1. Problem-Specific Base Indexers | ||
55105 | ////////// | ||
55106 | // 1.1 Type Indexers | ||
55107 | ////////// | ||
55108 | // 1.1.1 primitive Type Indexers | ||
55109 | ////////// | ||
55110 | |||
55111 | ////////// | ||
55112 | // 1.1.2 domain-specific Type Indexers | ||
55113 | ////////// | ||
55114 | /** | ||
55115 | * An element must be an instance of type "FunctionalElement class". | ||
55116 | */ | ||
55117 | private pattern mustInstanceOfFunctionalElement_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
55118 | Type.name(type,"FunctionalElement class"); | ||
55119 | find directInstanceOf(problem,interpretation,element,type); | ||
55120 | } | ||
55121 | private pattern scopeDisallowsNewFunctionalElement_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
55122 | find interpretation(problem,interpretation); | ||
55123 | PartialInterpretation.scopes(interpretation,scope); | ||
55124 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
55125 | Scope.maxNewElements(scope,0); | ||
55126 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
55127 | Type.name(type,"FunctionalElement class"); | ||
55128 | } | ||
55129 | |||
55130 | /** | ||
55131 | * An element may be an instance of type "FunctionalElement class". | ||
55132 | */ | ||
55133 | private pattern mayInstanceOfFunctionalElement_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
55134 | { | ||
55135 | find interpretation(problem,interpretation); | ||
55136 | PartialInterpretation.newElements(interpretation,element); | ||
55137 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
55138 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
55139 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
55140 | neg find mustInstanceOfFunction_class(problem,interpretation,element); | ||
55141 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
55142 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
55143 | neg find scopeDisallowsNewFunctionalElement_class(problem, interpretation); | ||
55144 | neg find isPrimitive(element); | ||
55145 | } or { | ||
55146 | find interpretation(problem,interpretation); | ||
55147 | PartialInterpretation.openWorldElements(interpretation,element); | ||
55148 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
55149 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
55150 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
55151 | neg find mustInstanceOfFunction_class(problem,interpretation,element); | ||
55152 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
55153 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
55154 | neg find scopeDisallowsNewFunctionalElement_class(problem, interpretation); | ||
55155 | neg find isPrimitive(element); | ||
55156 | } or | ||
55157 | { find mustInstanceOfFunctionalElement_class(problem,interpretation,element); } | ||
55158 | /** | ||
55159 | * An element must be an instance of type "FunctionalArchitectureModel class". | ||
55160 | */ | ||
55161 | private pattern mustInstanceOfFunctionalArchitectureModel_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
55162 | Type.name(type,"FunctionalArchitectureModel class"); | ||
55163 | find directInstanceOf(problem,interpretation,element,type); | ||
55164 | } | ||
55165 | private pattern scopeDisallowsNewFunctionalArchitectureModel_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
55166 | find interpretation(problem,interpretation); | ||
55167 | PartialInterpretation.scopes(interpretation,scope); | ||
55168 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
55169 | Scope.maxNewElements(scope,0); | ||
55170 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
55171 | Type.name(type,"FunctionalArchitectureModel class"); | ||
55172 | } | ||
55173 | |||
55174 | /** | ||
55175 | * An element may be an instance of type "FunctionalArchitectureModel class". | ||
55176 | */ | ||
55177 | private pattern mayInstanceOfFunctionalArchitectureModel_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
55178 | { | ||
55179 | find interpretation(problem,interpretation); | ||
55180 | PartialInterpretation.newElements(interpretation,element); | ||
55181 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
55182 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
55183 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
55184 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
55185 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
55186 | neg find scopeDisallowsNewFunctionalArchitectureModel_class(problem, interpretation); | ||
55187 | neg find isPrimitive(element); | ||
55188 | } or { | ||
55189 | find interpretation(problem,interpretation); | ||
55190 | PartialInterpretation.openWorldElements(interpretation,element); | ||
55191 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
55192 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
55193 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
55194 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
55195 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
55196 | neg find scopeDisallowsNewFunctionalArchitectureModel_class(problem, interpretation); | ||
55197 | neg find isPrimitive(element); | ||
55198 | } or | ||
55199 | { find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); } | ||
55200 | /** | ||
55201 | * An element must be an instance of type "Function class". | ||
55202 | */ | ||
55203 | private pattern mustInstanceOfFunction_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
55204 | Type.name(type,"Function class"); | ||
55205 | find directInstanceOf(problem,interpretation,element,type); | ||
55206 | } | ||
55207 | private pattern scopeDisallowsNewFunction_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
55208 | find interpretation(problem,interpretation); | ||
55209 | PartialInterpretation.scopes(interpretation,scope); | ||
55210 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
55211 | Scope.maxNewElements(scope,0); | ||
55212 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
55213 | Type.name(type,"Function class"); | ||
55214 | } | ||
55215 | |||
55216 | /** | ||
55217 | * An element may be an instance of type "Function class". | ||
55218 | */ | ||
55219 | private pattern mayInstanceOfFunction_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
55220 | { | ||
55221 | find interpretation(problem,interpretation); | ||
55222 | PartialInterpretation.newElements(interpretation,element); | ||
55223 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
55224 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
55225 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
55226 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
55227 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
55228 | neg find scopeDisallowsNewFunction_class(problem, interpretation); | ||
55229 | neg find isPrimitive(element); | ||
55230 | } or { | ||
55231 | find interpretation(problem,interpretation); | ||
55232 | PartialInterpretation.openWorldElements(interpretation,element); | ||
55233 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
55234 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
55235 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
55236 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
55237 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
55238 | neg find scopeDisallowsNewFunction_class(problem, interpretation); | ||
55239 | neg find isPrimitive(element); | ||
55240 | } or | ||
55241 | { find mustInstanceOfFunction_class(problem,interpretation,element); } | ||
55242 | /** | ||
55243 | * An element must be an instance of type "FAMTerminator class". | ||
55244 | */ | ||
55245 | private pattern mustInstanceOfFAMTerminator_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
55246 | Type.name(type,"FAMTerminator class"); | ||
55247 | find directInstanceOf(problem,interpretation,element,type); | ||
55248 | } | ||
55249 | private pattern scopeDisallowsNewFAMTerminator_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
55250 | find interpretation(problem,interpretation); | ||
55251 | PartialInterpretation.scopes(interpretation,scope); | ||
55252 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
55253 | Scope.maxNewElements(scope,0); | ||
55254 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
55255 | Type.name(type,"FAMTerminator class"); | ||
55256 | } | ||
55257 | |||
55258 | /** | ||
55259 | * An element may be an instance of type "FAMTerminator class". | ||
55260 | */ | ||
55261 | private pattern mayInstanceOfFAMTerminator_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
55262 | { | ||
55263 | find interpretation(problem,interpretation); | ||
55264 | PartialInterpretation.newElements(interpretation,element); | ||
55265 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
55266 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
55267 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
55268 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
55269 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
55270 | neg find scopeDisallowsNewFAMTerminator_class(problem, interpretation); | ||
55271 | neg find isPrimitive(element); | ||
55272 | } or { | ||
55273 | find interpretation(problem,interpretation); | ||
55274 | PartialInterpretation.openWorldElements(interpretation,element); | ||
55275 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
55276 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
55277 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
55278 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
55279 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
55280 | neg find scopeDisallowsNewFAMTerminator_class(problem, interpretation); | ||
55281 | neg find isPrimitive(element); | ||
55282 | } or | ||
55283 | { find mustInstanceOfFAMTerminator_class(problem,interpretation,element); } | ||
55284 | /** | ||
55285 | * An element must be an instance of type "InformationLink class". | ||
55286 | */ | ||
55287 | private pattern mustInstanceOfInformationLink_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
55288 | Type.name(type,"InformationLink class"); | ||
55289 | find directInstanceOf(problem,interpretation,element,type); | ||
55290 | } | ||
55291 | private pattern scopeDisallowsNewInformationLink_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
55292 | find interpretation(problem,interpretation); | ||
55293 | PartialInterpretation.scopes(interpretation,scope); | ||
55294 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
55295 | Scope.maxNewElements(scope,0); | ||
55296 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
55297 | Type.name(type,"InformationLink class"); | ||
55298 | } | ||
55299 | |||
55300 | /** | ||
55301 | * An element may be an instance of type "InformationLink class". | ||
55302 | */ | ||
55303 | private pattern mayInstanceOfInformationLink_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
55304 | { | ||
55305 | find interpretation(problem,interpretation); | ||
55306 | PartialInterpretation.newElements(interpretation,element); | ||
55307 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
55308 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
55309 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
55310 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
55311 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
55312 | neg find scopeDisallowsNewInformationLink_class(problem, interpretation); | ||
55313 | neg find isPrimitive(element); | ||
55314 | } or { | ||
55315 | find interpretation(problem,interpretation); | ||
55316 | PartialInterpretation.openWorldElements(interpretation,element); | ||
55317 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
55318 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
55319 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
55320 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
55321 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
55322 | neg find scopeDisallowsNewInformationLink_class(problem, interpretation); | ||
55323 | neg find isPrimitive(element); | ||
55324 | } or | ||
55325 | { find mustInstanceOfInformationLink_class(problem,interpretation,element); } | ||
55326 | /** | ||
55327 | * An element must be an instance of type "FunctionalInterface class". | ||
55328 | */ | ||
55329 | private pattern mustInstanceOfFunctionalInterface_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
55330 | Type.name(type,"FunctionalInterface class"); | ||
55331 | find directInstanceOf(problem,interpretation,element,type); | ||
55332 | } | ||
55333 | private pattern scopeDisallowsNewFunctionalInterface_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
55334 | find interpretation(problem,interpretation); | ||
55335 | PartialInterpretation.scopes(interpretation,scope); | ||
55336 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
55337 | Scope.maxNewElements(scope,0); | ||
55338 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
55339 | Type.name(type,"FunctionalInterface class"); | ||
55340 | } | ||
55341 | |||
55342 | /** | ||
55343 | * An element may be an instance of type "FunctionalInterface class". | ||
55344 | */ | ||
55345 | private pattern mayInstanceOfFunctionalInterface_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
55346 | { | ||
55347 | find interpretation(problem,interpretation); | ||
55348 | PartialInterpretation.newElements(interpretation,element); | ||
55349 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
55350 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
55351 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
55352 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
55353 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
55354 | neg find scopeDisallowsNewFunctionalInterface_class(problem, interpretation); | ||
55355 | neg find isPrimitive(element); | ||
55356 | } or { | ||
55357 | find interpretation(problem,interpretation); | ||
55358 | PartialInterpretation.openWorldElements(interpretation,element); | ||
55359 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
55360 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
55361 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
55362 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
55363 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
55364 | neg find scopeDisallowsNewFunctionalInterface_class(problem, interpretation); | ||
55365 | neg find isPrimitive(element); | ||
55366 | } or | ||
55367 | { find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); } | ||
55368 | /** | ||
55369 | * An element must be an instance of type "FunctionalInput class". | ||
55370 | */ | ||
55371 | private pattern mustInstanceOfFunctionalInput_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
55372 | Type.name(type,"FunctionalInput class"); | ||
55373 | find directInstanceOf(problem,interpretation,element,type); | ||
55374 | } | ||
55375 | private pattern scopeDisallowsNewFunctionalInput_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
55376 | find interpretation(problem,interpretation); | ||
55377 | PartialInterpretation.scopes(interpretation,scope); | ||
55378 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
55379 | Scope.maxNewElements(scope,0); | ||
55380 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
55381 | Type.name(type,"FunctionalInput class"); | ||
55382 | } | ||
55383 | |||
55384 | /** | ||
55385 | * An element may be an instance of type "FunctionalInput class". | ||
55386 | */ | ||
55387 | private pattern mayInstanceOfFunctionalInput_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
55388 | { | ||
55389 | find interpretation(problem,interpretation); | ||
55390 | PartialInterpretation.newElements(interpretation,element); | ||
55391 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
55392 | neg find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
55393 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
55394 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
55395 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
55396 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
55397 | neg find scopeDisallowsNewFunctionalInput_class(problem, interpretation); | ||
55398 | neg find isPrimitive(element); | ||
55399 | } or { | ||
55400 | find interpretation(problem,interpretation); | ||
55401 | PartialInterpretation.openWorldElements(interpretation,element); | ||
55402 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
55403 | neg find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
55404 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
55405 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
55406 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
55407 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
55408 | neg find scopeDisallowsNewFunctionalInput_class(problem, interpretation); | ||
55409 | neg find isPrimitive(element); | ||
55410 | } or | ||
55411 | { find mustInstanceOfFunctionalInput_class(problem,interpretation,element); } | ||
55412 | /** | ||
55413 | * An element must be an instance of type "FunctionalOutput class". | ||
55414 | */ | ||
55415 | private pattern mustInstanceOfFunctionalOutput_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
55416 | Type.name(type,"FunctionalOutput class"); | ||
55417 | find directInstanceOf(problem,interpretation,element,type); | ||
55418 | } | ||
55419 | private pattern scopeDisallowsNewFunctionalOutput_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
55420 | find interpretation(problem,interpretation); | ||
55421 | PartialInterpretation.scopes(interpretation,scope); | ||
55422 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
55423 | Scope.maxNewElements(scope,0); | ||
55424 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
55425 | Type.name(type,"FunctionalOutput class"); | ||
55426 | } | ||
55427 | |||
55428 | /** | ||
55429 | * An element may be an instance of type "FunctionalOutput class". | ||
55430 | */ | ||
55431 | private pattern mayInstanceOfFunctionalOutput_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
55432 | { | ||
55433 | find interpretation(problem,interpretation); | ||
55434 | PartialInterpretation.newElements(interpretation,element); | ||
55435 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
55436 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
55437 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
55438 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
55439 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
55440 | neg find mustInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
55441 | neg find scopeDisallowsNewFunctionalOutput_class(problem, interpretation); | ||
55442 | neg find isPrimitive(element); | ||
55443 | } or { | ||
55444 | find interpretation(problem,interpretation); | ||
55445 | PartialInterpretation.openWorldElements(interpretation,element); | ||
55446 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
55447 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
55448 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
55449 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
55450 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
55451 | neg find mustInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
55452 | neg find scopeDisallowsNewFunctionalOutput_class(problem, interpretation); | ||
55453 | neg find isPrimitive(element); | ||
55454 | } or | ||
55455 | { find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); } | ||
55456 | /** | ||
55457 | * An element must be an instance of type "FunctionalData class". | ||
55458 | */ | ||
55459 | private pattern mustInstanceOfFunctionalData_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
55460 | Type.name(type,"FunctionalData class"); | ||
55461 | find directInstanceOf(problem,interpretation,element,type); | ||
55462 | } | ||
55463 | private pattern scopeDisallowsNewFunctionalData_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
55464 | find interpretation(problem,interpretation); | ||
55465 | PartialInterpretation.scopes(interpretation,scope); | ||
55466 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
55467 | Scope.maxNewElements(scope,0); | ||
55468 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
55469 | Type.name(type,"FunctionalData class"); | ||
55470 | } | ||
55471 | |||
55472 | /** | ||
55473 | * An element may be an instance of type "FunctionalData class". | ||
55474 | */ | ||
55475 | private pattern mayInstanceOfFunctionalData_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
55476 | { | ||
55477 | find interpretation(problem,interpretation); | ||
55478 | PartialInterpretation.newElements(interpretation,element); | ||
55479 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
55480 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
55481 | neg find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
55482 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
55483 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
55484 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
55485 | neg find mustInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
55486 | neg find scopeDisallowsNewFunctionalData_class(problem, interpretation); | ||
55487 | neg find isPrimitive(element); | ||
55488 | } or { | ||
55489 | find interpretation(problem,interpretation); | ||
55490 | PartialInterpretation.openWorldElements(interpretation,element); | ||
55491 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
55492 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
55493 | neg find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
55494 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
55495 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
55496 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
55497 | neg find mustInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
55498 | neg find scopeDisallowsNewFunctionalData_class(problem, interpretation); | ||
55499 | neg find isPrimitive(element); | ||
55500 | } or | ||
55501 | { find mustInstanceOfFunctionalData_class(problem,interpretation,element); } | ||
55502 | /** | ||
55503 | * An element must be an instance of type "FunctionType enum". | ||
55504 | */ | ||
55505 | private pattern mustInstanceOfFunctionType_enum(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
55506 | Type.name(type,"FunctionType enum"); | ||
55507 | find directInstanceOf(problem,interpretation,element,type); | ||
55508 | } | ||
55509 | private pattern scopeDisallowsNewFunctionType_enum(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
55510 | find interpretation(problem,interpretation); | ||
55511 | PartialInterpretation.scopes(interpretation,scope); | ||
55512 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
55513 | Scope.maxNewElements(scope,0); | ||
55514 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
55515 | Type.name(type,"FunctionType enum"); | ||
55516 | } | ||
55517 | |||
55518 | /** | ||
55519 | * An element may be an instance of type "FunctionType enum". | ||
55520 | */ | ||
55521 | private pattern mayInstanceOfFunctionType_enum(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
55522 | { find mustInstanceOfFunctionType_enum(problem,interpretation,element); } | ||
55523 | |||
55524 | ////////// | ||
55525 | // 1.2 Relation Declaration Indexers | ||
55526 | ////////// | ||
55527 | /** | ||
55528 | * Matcher for detecting tuples t where []interface reference FunctionalElement(source,target) | ||
55529 | */ | ||
55530 | private pattern mustInRelationinterface_reference_FunctionalElement( | ||
55531 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
55532 | source: DefinedElement, target:DefinedElement) | ||
55533 | { | ||
55534 | find interpretation(problem,interpretation); | ||
55535 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
55536 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"interface reference FunctionalElement"); | ||
55537 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
55538 | BinaryElementRelationLink.param1(link,source); | ||
55539 | BinaryElementRelationLink.param2(link,target); | ||
55540 | } | ||
55541 | /** | ||
55542 | * Matcher for detecting tuples t where <>interface reference FunctionalElement(source,target) | ||
55543 | */ | ||
55544 | private pattern mayInRelationinterface_reference_FunctionalElement( | ||
55545 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
55546 | source: DefinedElement, target:DefinedElement) | ||
55547 | { | ||
55548 | find interpretation(problem,interpretation); | ||
55549 | // The two endpoint of the link have to exist | ||
55550 | find mayExist(problem, interpretation, source); | ||
55551 | find mayExist(problem, interpretation, target); | ||
55552 | // Type consistency | ||
55553 | find mayInstanceOfFunctionalElement_class(problem,interpretation,source); | ||
55554 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,target); | ||
55555 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
55556 | // the upper bound of the multiplicity should be considered. | ||
55557 | numberOfExistingReferences == count find mustInRelationinterface_reference_FunctionalElement(problem,interpretation,source,_); | ||
55558 | check(numberOfExistingReferences < 1); | ||
55559 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
55560 | // the upper bound of the opposite reference multiplicity should be considered. | ||
55561 | numberOfExistingOppositeReferences == count find mustInRelationelement_reference_FunctionalInterface(problem,interpretation,target,_); | ||
55562 | check(numberOfExistingOppositeReferences < 1); | ||
55563 | // The reference is containment, then a new reference cannot be create if: | ||
55564 | // 1. Multiple parents | ||
55565 | neg find mustContains4(problem,interpretation,_,target); | ||
55566 | // 2. Circle in the containment hierarchy | ||
55567 | neg find mustTransitiveContains(source,target); | ||
55568 | } or { | ||
55569 | find mustInRelationinterface_reference_FunctionalElement(problem,interpretation,source,target); | ||
55570 | } | ||
55571 | /** | ||
55572 | * Matcher for detecting tuples t where []model reference FunctionalElement(source,target) | ||
55573 | */ | ||
55574 | private pattern mustInRelationmodel_reference_FunctionalElement( | ||
55575 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
55576 | source: DefinedElement, target:DefinedElement) | ||
55577 | { | ||
55578 | find interpretation(problem,interpretation); | ||
55579 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
55580 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"model reference FunctionalElement"); | ||
55581 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
55582 | BinaryElementRelationLink.param1(link,source); | ||
55583 | BinaryElementRelationLink.param2(link,target); | ||
55584 | } | ||
55585 | /** | ||
55586 | * Matcher for detecting tuples t where <>model reference FunctionalElement(source,target) | ||
55587 | */ | ||
55588 | private pattern mayInRelationmodel_reference_FunctionalElement( | ||
55589 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
55590 | source: DefinedElement, target:DefinedElement) | ||
55591 | { | ||
55592 | find interpretation(problem,interpretation); | ||
55593 | // The two endpoint of the link have to exist | ||
55594 | find mayExist(problem, interpretation, source); | ||
55595 | find mayExist(problem, interpretation, target); | ||
55596 | // Type consistency | ||
55597 | find mayInstanceOfFunctionalElement_class(problem,interpretation,source); | ||
55598 | find mayInstanceOfFunctionalArchitectureModel_class(problem,interpretation,target); | ||
55599 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
55600 | // the upper bound of the multiplicity should be considered. | ||
55601 | numberOfExistingReferences == count find mustInRelationmodel_reference_FunctionalElement(problem,interpretation,source,_); | ||
55602 | check(numberOfExistingReferences < 1); | ||
55603 | } or { | ||
55604 | find mustInRelationmodel_reference_FunctionalElement(problem,interpretation,source,target); | ||
55605 | } | ||
55606 | /** | ||
55607 | * Matcher for detecting tuples t where []parent reference FunctionalElement(source,target) | ||
55608 | */ | ||
55609 | private pattern mustInRelationparent_reference_FunctionalElement( | ||
55610 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
55611 | source: DefinedElement, target:DefinedElement) | ||
55612 | { | ||
55613 | find interpretation(problem,interpretation); | ||
55614 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
55615 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"parent reference FunctionalElement"); | ||
55616 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
55617 | BinaryElementRelationLink.param1(link,source); | ||
55618 | BinaryElementRelationLink.param2(link,target); | ||
55619 | } | ||
55620 | /** | ||
55621 | * Matcher for detecting tuples t where <>parent reference FunctionalElement(source,target) | ||
55622 | */ | ||
55623 | private pattern mayInRelationparent_reference_FunctionalElement( | ||
55624 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
55625 | source: DefinedElement, target:DefinedElement) | ||
55626 | { | ||
55627 | find interpretation(problem,interpretation); | ||
55628 | // The two endpoint of the link have to exist | ||
55629 | find mayExist(problem, interpretation, source); | ||
55630 | find mayExist(problem, interpretation, target); | ||
55631 | // Type consistency | ||
55632 | find mayInstanceOfFunctionalElement_class(problem,interpretation,source); | ||
55633 | find mayInstanceOfFunction_class(problem,interpretation,target); | ||
55634 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
55635 | // the upper bound of the multiplicity should be considered. | ||
55636 | numberOfExistingReferences == count find mustInRelationparent_reference_FunctionalElement(problem,interpretation,source,_); | ||
55637 | check(numberOfExistingReferences < 1); | ||
55638 | // The eOpposite of the reference is containment, then a referene cannot be created if | ||
55639 | // 1. Multiple parents | ||
55640 | neg find mustContains4(problem,interpretation,source,_); | ||
55641 | // 2. Circle in the containment hierarchy | ||
55642 | neg find mustTransitiveContains(source,target); | ||
55643 | } or { | ||
55644 | find mustInRelationparent_reference_FunctionalElement(problem,interpretation,source,target); | ||
55645 | } | ||
55646 | /** | ||
55647 | * Matcher for detecting tuples t where []rootElements reference FunctionalArchitectureModel(source,target) | ||
55648 | */ | ||
55649 | private pattern mustInRelationrootElements_reference_FunctionalArchitectureModel( | ||
55650 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
55651 | source: DefinedElement, target:DefinedElement) | ||
55652 | { | ||
55653 | find interpretation(problem,interpretation); | ||
55654 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
55655 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"rootElements reference FunctionalArchitectureModel"); | ||
55656 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
55657 | BinaryElementRelationLink.param1(link,source); | ||
55658 | BinaryElementRelationLink.param2(link,target); | ||
55659 | } | ||
55660 | /** | ||
55661 | * Matcher for detecting tuples t where <>rootElements reference FunctionalArchitectureModel(source,target) | ||
55662 | */ | ||
55663 | private pattern mayInRelationrootElements_reference_FunctionalArchitectureModel( | ||
55664 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
55665 | source: DefinedElement, target:DefinedElement) | ||
55666 | { | ||
55667 | find interpretation(problem,interpretation); | ||
55668 | // The two endpoint of the link have to exist | ||
55669 | find mayExist(problem, interpretation, source); | ||
55670 | find mayExist(problem, interpretation, target); | ||
55671 | // Type consistency | ||
55672 | find mayInstanceOfFunctionalArchitectureModel_class(problem,interpretation,source); | ||
55673 | find mayInstanceOfFunctionalElement_class(problem,interpretation,target); | ||
55674 | // The reference is containment, then a new reference cannot be create if: | ||
55675 | // 1. Multiple parents | ||
55676 | neg find mustContains4(problem,interpretation,_,target); | ||
55677 | // 2. Circle in the containment hierarchy | ||
55678 | neg find mustTransitiveContains(source,target); | ||
55679 | } or { | ||
55680 | find mustInRelationrootElements_reference_FunctionalArchitectureModel(problem,interpretation,source,target); | ||
55681 | } | ||
55682 | /** | ||
55683 | * Matcher for detecting tuples t where []subElements reference Function(source,target) | ||
55684 | */ | ||
55685 | private pattern mustInRelationsubElements_reference_Function( | ||
55686 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
55687 | source: DefinedElement, target:DefinedElement) | ||
55688 | { | ||
55689 | find interpretation(problem,interpretation); | ||
55690 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
55691 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"subElements reference Function"); | ||
55692 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
55693 | BinaryElementRelationLink.param1(link,source); | ||
55694 | BinaryElementRelationLink.param2(link,target); | ||
55695 | } | ||
55696 | /** | ||
55697 | * Matcher for detecting tuples t where <>subElements reference Function(source,target) | ||
55698 | */ | ||
55699 | private pattern mayInRelationsubElements_reference_Function( | ||
55700 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
55701 | source: DefinedElement, target:DefinedElement) | ||
55702 | { | ||
55703 | find interpretation(problem,interpretation); | ||
55704 | // The two endpoint of the link have to exist | ||
55705 | find mayExist(problem, interpretation, source); | ||
55706 | find mayExist(problem, interpretation, target); | ||
55707 | // Type consistency | ||
55708 | find mayInstanceOfFunction_class(problem,interpretation,source); | ||
55709 | find mayInstanceOfFunctionalElement_class(problem,interpretation,target); | ||
55710 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
55711 | // the upper bound of the opposite reference multiplicity should be considered. | ||
55712 | numberOfExistingOppositeReferences == count find mustInRelationparent_reference_FunctionalElement(problem,interpretation,target,_); | ||
55713 | check(numberOfExistingOppositeReferences < 1); | ||
55714 | // The reference is containment, then a new reference cannot be create if: | ||
55715 | // 1. Multiple parents | ||
55716 | neg find mustContains4(problem,interpretation,_,target); | ||
55717 | // 2. Circle in the containment hierarchy | ||
55718 | neg find mustTransitiveContains(source,target); | ||
55719 | } or { | ||
55720 | find mustInRelationsubElements_reference_Function(problem,interpretation,source,target); | ||
55721 | } | ||
55722 | /** | ||
55723 | * Matcher for detecting tuples t where []data reference FAMTerminator(source,target) | ||
55724 | */ | ||
55725 | private pattern mustInRelationdata_reference_FAMTerminator( | ||
55726 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
55727 | source: DefinedElement, target:DefinedElement) | ||
55728 | { | ||
55729 | find interpretation(problem,interpretation); | ||
55730 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
55731 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"data reference FAMTerminator"); | ||
55732 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
55733 | BinaryElementRelationLink.param1(link,source); | ||
55734 | BinaryElementRelationLink.param2(link,target); | ||
55735 | } | ||
55736 | /** | ||
55737 | * Matcher for detecting tuples t where <>data reference FAMTerminator(source,target) | ||
55738 | */ | ||
55739 | private pattern mayInRelationdata_reference_FAMTerminator( | ||
55740 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
55741 | source: DefinedElement, target:DefinedElement) | ||
55742 | { | ||
55743 | find interpretation(problem,interpretation); | ||
55744 | // The two endpoint of the link have to exist | ||
55745 | find mayExist(problem, interpretation, source); | ||
55746 | find mayExist(problem, interpretation, target); | ||
55747 | // Type consistency | ||
55748 | find mayInstanceOfFAMTerminator_class(problem,interpretation,source); | ||
55749 | find mayInstanceOfFunctionalData_class(problem,interpretation,target); | ||
55750 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
55751 | // the upper bound of the multiplicity should be considered. | ||
55752 | numberOfExistingReferences == count find mustInRelationdata_reference_FAMTerminator(problem,interpretation,source,_); | ||
55753 | check(numberOfExistingReferences < 1); | ||
55754 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
55755 | // the upper bound of the opposite reference multiplicity should be considered. | ||
55756 | numberOfExistingOppositeReferences == count find mustInRelationterminator_reference_FunctionalData(problem,interpretation,target,_); | ||
55757 | check(numberOfExistingOppositeReferences < 1); | ||
55758 | // The eOpposite of the reference is containment, then a referene cannot be created if | ||
55759 | // 1. Multiple parents | ||
55760 | neg find mustContains4(problem,interpretation,source,_); | ||
55761 | // 2. Circle in the containment hierarchy | ||
55762 | neg find mustTransitiveContains(source,target); | ||
55763 | } or { | ||
55764 | find mustInRelationdata_reference_FAMTerminator(problem,interpretation,source,target); | ||
55765 | } | ||
55766 | /** | ||
55767 | * Matcher for detecting tuples t where []from reference InformationLink(source,target) | ||
55768 | */ | ||
55769 | private pattern mustInRelationfrom_reference_InformationLink( | ||
55770 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
55771 | source: DefinedElement, target:DefinedElement) | ||
55772 | { | ||
55773 | find interpretation(problem,interpretation); | ||
55774 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
55775 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"from reference InformationLink"); | ||
55776 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
55777 | BinaryElementRelationLink.param1(link,source); | ||
55778 | BinaryElementRelationLink.param2(link,target); | ||
55779 | } | ||
55780 | /** | ||
55781 | * Matcher for detecting tuples t where <>from reference InformationLink(source,target) | ||
55782 | */ | ||
55783 | private pattern mayInRelationfrom_reference_InformationLink( | ||
55784 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
55785 | source: DefinedElement, target:DefinedElement) | ||
55786 | { | ||
55787 | find interpretation(problem,interpretation); | ||
55788 | // The two endpoint of the link have to exist | ||
55789 | find mayExist(problem, interpretation, source); | ||
55790 | find mayExist(problem, interpretation, target); | ||
55791 | // Type consistency | ||
55792 | find mayInstanceOfInformationLink_class(problem,interpretation,source); | ||
55793 | find mayInstanceOfFunctionalOutput_class(problem,interpretation,target); | ||
55794 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
55795 | // the upper bound of the multiplicity should be considered. | ||
55796 | numberOfExistingReferences == count find mustInRelationfrom_reference_InformationLink(problem,interpretation,source,_); | ||
55797 | check(numberOfExistingReferences < 1); | ||
55798 | // The eOpposite of the reference is containment, then a referene cannot be created if | ||
55799 | // 1. Multiple parents | ||
55800 | neg find mustContains4(problem,interpretation,source,_); | ||
55801 | // 2. Circle in the containment hierarchy | ||
55802 | neg find mustTransitiveContains(source,target); | ||
55803 | } or { | ||
55804 | find mustInRelationfrom_reference_InformationLink(problem,interpretation,source,target); | ||
55805 | } | ||
55806 | /** | ||
55807 | * Matcher for detecting tuples t where []to reference InformationLink(source,target) | ||
55808 | */ | ||
55809 | private pattern mustInRelationto_reference_InformationLink( | ||
55810 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
55811 | source: DefinedElement, target:DefinedElement) | ||
55812 | { | ||
55813 | find interpretation(problem,interpretation); | ||
55814 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
55815 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"to reference InformationLink"); | ||
55816 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
55817 | BinaryElementRelationLink.param1(link,source); | ||
55818 | BinaryElementRelationLink.param2(link,target); | ||
55819 | } | ||
55820 | /** | ||
55821 | * Matcher for detecting tuples t where <>to reference InformationLink(source,target) | ||
55822 | */ | ||
55823 | private pattern mayInRelationto_reference_InformationLink( | ||
55824 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
55825 | source: DefinedElement, target:DefinedElement) | ||
55826 | { | ||
55827 | find interpretation(problem,interpretation); | ||
55828 | // The two endpoint of the link have to exist | ||
55829 | find mayExist(problem, interpretation, source); | ||
55830 | find mayExist(problem, interpretation, target); | ||
55831 | // Type consistency | ||
55832 | find mayInstanceOfInformationLink_class(problem,interpretation,source); | ||
55833 | find mayInstanceOfFunctionalInput_class(problem,interpretation,target); | ||
55834 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
55835 | // the upper bound of the multiplicity should be considered. | ||
55836 | numberOfExistingReferences == count find mustInRelationto_reference_InformationLink(problem,interpretation,source,_); | ||
55837 | check(numberOfExistingReferences < 1); | ||
55838 | } or { | ||
55839 | find mustInRelationto_reference_InformationLink(problem,interpretation,source,target); | ||
55840 | } | ||
55841 | /** | ||
55842 | * Matcher for detecting tuples t where []data reference FunctionalInterface(source,target) | ||
55843 | */ | ||
55844 | private pattern mustInRelationdata_reference_FunctionalInterface( | ||
55845 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
55846 | source: DefinedElement, target:DefinedElement) | ||
55847 | { | ||
55848 | find interpretation(problem,interpretation); | ||
55849 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
55850 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"data reference FunctionalInterface"); | ||
55851 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
55852 | BinaryElementRelationLink.param1(link,source); | ||
55853 | BinaryElementRelationLink.param2(link,target); | ||
55854 | } | ||
55855 | /** | ||
55856 | * Matcher for detecting tuples t where <>data reference FunctionalInterface(source,target) | ||
55857 | */ | ||
55858 | private pattern mayInRelationdata_reference_FunctionalInterface( | ||
55859 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
55860 | source: DefinedElement, target:DefinedElement) | ||
55861 | { | ||
55862 | find interpretation(problem,interpretation); | ||
55863 | // The two endpoint of the link have to exist | ||
55864 | find mayExist(problem, interpretation, source); | ||
55865 | find mayExist(problem, interpretation, target); | ||
55866 | // Type consistency | ||
55867 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,source); | ||
55868 | find mayInstanceOfFunctionalData_class(problem,interpretation,target); | ||
55869 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
55870 | // the upper bound of the opposite reference multiplicity should be considered. | ||
55871 | numberOfExistingOppositeReferences == count find mustInRelationinterface_reference_FunctionalData(problem,interpretation,target,_); | ||
55872 | check(numberOfExistingOppositeReferences < 1); | ||
55873 | // The reference is containment, then a new reference cannot be create if: | ||
55874 | // 1. Multiple parents | ||
55875 | neg find mustContains4(problem,interpretation,_,target); | ||
55876 | // 2. Circle in the containment hierarchy | ||
55877 | neg find mustTransitiveContains(source,target); | ||
55878 | } or { | ||
55879 | find mustInRelationdata_reference_FunctionalInterface(problem,interpretation,source,target); | ||
55880 | } | ||
55881 | /** | ||
55882 | * Matcher for detecting tuples t where []element reference FunctionalInterface(source,target) | ||
55883 | */ | ||
55884 | private pattern mustInRelationelement_reference_FunctionalInterface( | ||
55885 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
55886 | source: DefinedElement, target:DefinedElement) | ||
55887 | { | ||
55888 | find interpretation(problem,interpretation); | ||
55889 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
55890 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"element reference FunctionalInterface"); | ||
55891 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
55892 | BinaryElementRelationLink.param1(link,source); | ||
55893 | BinaryElementRelationLink.param2(link,target); | ||
55894 | } | ||
55895 | /** | ||
55896 | * Matcher for detecting tuples t where <>element reference FunctionalInterface(source,target) | ||
55897 | */ | ||
55898 | private pattern mayInRelationelement_reference_FunctionalInterface( | ||
55899 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
55900 | source: DefinedElement, target:DefinedElement) | ||
55901 | { | ||
55902 | find interpretation(problem,interpretation); | ||
55903 | // The two endpoint of the link have to exist | ||
55904 | find mayExist(problem, interpretation, source); | ||
55905 | find mayExist(problem, interpretation, target); | ||
55906 | // Type consistency | ||
55907 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,source); | ||
55908 | find mayInstanceOfFunctionalElement_class(problem,interpretation,target); | ||
55909 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
55910 | // the upper bound of the multiplicity should be considered. | ||
55911 | numberOfExistingReferences == count find mustInRelationelement_reference_FunctionalInterface(problem,interpretation,source,_); | ||
55912 | check(numberOfExistingReferences < 1); | ||
55913 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
55914 | // the upper bound of the opposite reference multiplicity should be considered. | ||
55915 | numberOfExistingOppositeReferences == count find mustInRelationinterface_reference_FunctionalElement(problem,interpretation,target,_); | ||
55916 | check(numberOfExistingOppositeReferences < 1); | ||
55917 | // The eOpposite of the reference is containment, then a referene cannot be created if | ||
55918 | // 1. Multiple parents | ||
55919 | neg find mustContains4(problem,interpretation,source,_); | ||
55920 | // 2. Circle in the containment hierarchy | ||
55921 | neg find mustTransitiveContains(source,target); | ||
55922 | } or { | ||
55923 | find mustInRelationelement_reference_FunctionalInterface(problem,interpretation,source,target); | ||
55924 | } | ||
55925 | /** | ||
55926 | * Matcher for detecting tuples t where []IncomingLinks reference FunctionalInput(source,target) | ||
55927 | */ | ||
55928 | private pattern mustInRelationIncomingLinks_reference_FunctionalInput( | ||
55929 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
55930 | source: DefinedElement, target:DefinedElement) | ||
55931 | { | ||
55932 | find interpretation(problem,interpretation); | ||
55933 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
55934 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"IncomingLinks reference FunctionalInput"); | ||
55935 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
55936 | BinaryElementRelationLink.param1(link,source); | ||
55937 | BinaryElementRelationLink.param2(link,target); | ||
55938 | } | ||
55939 | /** | ||
55940 | * Matcher for detecting tuples t where <>IncomingLinks reference FunctionalInput(source,target) | ||
55941 | */ | ||
55942 | private pattern mayInRelationIncomingLinks_reference_FunctionalInput( | ||
55943 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
55944 | source: DefinedElement, target:DefinedElement) | ||
55945 | { | ||
55946 | find interpretation(problem,interpretation); | ||
55947 | // The two endpoint of the link have to exist | ||
55948 | find mayExist(problem, interpretation, source); | ||
55949 | find mayExist(problem, interpretation, target); | ||
55950 | // Type consistency | ||
55951 | find mayInstanceOfFunctionalInput_class(problem,interpretation,source); | ||
55952 | find mayInstanceOfInformationLink_class(problem,interpretation,target); | ||
55953 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
55954 | // the upper bound of the opposite reference multiplicity should be considered. | ||
55955 | numberOfExistingOppositeReferences == count find mustInRelationto_reference_InformationLink(problem,interpretation,target,_); | ||
55956 | check(numberOfExistingOppositeReferences < 1); | ||
55957 | } or { | ||
55958 | find mustInRelationIncomingLinks_reference_FunctionalInput(problem,interpretation,source,target); | ||
55959 | } | ||
55960 | /** | ||
55961 | * Matcher for detecting tuples t where []outgoingLinks reference FunctionalOutput(source,target) | ||
55962 | */ | ||
55963 | private pattern mustInRelationoutgoingLinks_reference_FunctionalOutput( | ||
55964 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
55965 | source: DefinedElement, target:DefinedElement) | ||
55966 | { | ||
55967 | find interpretation(problem,interpretation); | ||
55968 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
55969 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"outgoingLinks reference FunctionalOutput"); | ||
55970 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
55971 | BinaryElementRelationLink.param1(link,source); | ||
55972 | BinaryElementRelationLink.param2(link,target); | ||
55973 | } | ||
55974 | /** | ||
55975 | * Matcher for detecting tuples t where <>outgoingLinks reference FunctionalOutput(source,target) | ||
55976 | */ | ||
55977 | private pattern mayInRelationoutgoingLinks_reference_FunctionalOutput( | ||
55978 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
55979 | source: DefinedElement, target:DefinedElement) | ||
55980 | { | ||
55981 | find interpretation(problem,interpretation); | ||
55982 | // The two endpoint of the link have to exist | ||
55983 | find mayExist(problem, interpretation, source); | ||
55984 | find mayExist(problem, interpretation, target); | ||
55985 | // Type consistency | ||
55986 | find mayInstanceOfFunctionalOutput_class(problem,interpretation,source); | ||
55987 | find mayInstanceOfInformationLink_class(problem,interpretation,target); | ||
55988 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
55989 | // the upper bound of the opposite reference multiplicity should be considered. | ||
55990 | numberOfExistingOppositeReferences == count find mustInRelationfrom_reference_InformationLink(problem,interpretation,target,_); | ||
55991 | check(numberOfExistingOppositeReferences < 1); | ||
55992 | // The reference is containment, then a new reference cannot be create if: | ||
55993 | // 1. Multiple parents | ||
55994 | neg find mustContains4(problem,interpretation,_,target); | ||
55995 | // 2. Circle in the containment hierarchy | ||
55996 | neg find mustTransitiveContains(source,target); | ||
55997 | } or { | ||
55998 | find mustInRelationoutgoingLinks_reference_FunctionalOutput(problem,interpretation,source,target); | ||
55999 | } | ||
56000 | /** | ||
56001 | * Matcher for detecting tuples t where []terminator reference FunctionalData(source,target) | ||
56002 | */ | ||
56003 | private pattern mustInRelationterminator_reference_FunctionalData( | ||
56004 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
56005 | source: DefinedElement, target:DefinedElement) | ||
56006 | { | ||
56007 | find interpretation(problem,interpretation); | ||
56008 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
56009 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"terminator reference FunctionalData"); | ||
56010 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
56011 | BinaryElementRelationLink.param1(link,source); | ||
56012 | BinaryElementRelationLink.param2(link,target); | ||
56013 | } | ||
56014 | /** | ||
56015 | * Matcher for detecting tuples t where <>terminator reference FunctionalData(source,target) | ||
56016 | */ | ||
56017 | private pattern mayInRelationterminator_reference_FunctionalData( | ||
56018 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
56019 | source: DefinedElement, target:DefinedElement) | ||
56020 | { | ||
56021 | find interpretation(problem,interpretation); | ||
56022 | // The two endpoint of the link have to exist | ||
56023 | find mayExist(problem, interpretation, source); | ||
56024 | find mayExist(problem, interpretation, target); | ||
56025 | // Type consistency | ||
56026 | find mayInstanceOfFunctionalData_class(problem,interpretation,source); | ||
56027 | find mayInstanceOfFAMTerminator_class(problem,interpretation,target); | ||
56028 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
56029 | // the upper bound of the multiplicity should be considered. | ||
56030 | numberOfExistingReferences == count find mustInRelationterminator_reference_FunctionalData(problem,interpretation,source,_); | ||
56031 | check(numberOfExistingReferences < 1); | ||
56032 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
56033 | // the upper bound of the opposite reference multiplicity should be considered. | ||
56034 | numberOfExistingOppositeReferences == count find mustInRelationdata_reference_FAMTerminator(problem,interpretation,target,_); | ||
56035 | check(numberOfExistingOppositeReferences < 1); | ||
56036 | // The reference is containment, then a new reference cannot be create if: | ||
56037 | // 1. Multiple parents | ||
56038 | neg find mustContains4(problem,interpretation,_,target); | ||
56039 | // 2. Circle in the containment hierarchy | ||
56040 | neg find mustTransitiveContains(source,target); | ||
56041 | } or { | ||
56042 | find mustInRelationterminator_reference_FunctionalData(problem,interpretation,source,target); | ||
56043 | } | ||
56044 | /** | ||
56045 | * Matcher for detecting tuples t where []interface reference FunctionalData(source,target) | ||
56046 | */ | ||
56047 | private pattern mustInRelationinterface_reference_FunctionalData( | ||
56048 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
56049 | source: DefinedElement, target:DefinedElement) | ||
56050 | { | ||
56051 | find interpretation(problem,interpretation); | ||
56052 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
56053 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"interface reference FunctionalData"); | ||
56054 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
56055 | BinaryElementRelationLink.param1(link,source); | ||
56056 | BinaryElementRelationLink.param2(link,target); | ||
56057 | } | ||
56058 | /** | ||
56059 | * Matcher for detecting tuples t where <>interface reference FunctionalData(source,target) | ||
56060 | */ | ||
56061 | private pattern mayInRelationinterface_reference_FunctionalData( | ||
56062 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
56063 | source: DefinedElement, target:DefinedElement) | ||
56064 | { | ||
56065 | find interpretation(problem,interpretation); | ||
56066 | // The two endpoint of the link have to exist | ||
56067 | find mayExist(problem, interpretation, source); | ||
56068 | find mayExist(problem, interpretation, target); | ||
56069 | // Type consistency | ||
56070 | find mayInstanceOfFunctionalData_class(problem,interpretation,source); | ||
56071 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,target); | ||
56072 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
56073 | // the upper bound of the multiplicity should be considered. | ||
56074 | numberOfExistingReferences == count find mustInRelationinterface_reference_FunctionalData(problem,interpretation,source,_); | ||
56075 | check(numberOfExistingReferences < 1); | ||
56076 | // The eOpposite of the reference is containment, then a referene cannot be created if | ||
56077 | // 1. Multiple parents | ||
56078 | neg find mustContains4(problem,interpretation,source,_); | ||
56079 | // 2. Circle in the containment hierarchy | ||
56080 | neg find mustTransitiveContains(source,target); | ||
56081 | } or { | ||
56082 | find mustInRelationinterface_reference_FunctionalData(problem,interpretation,source,target); | ||
56083 | } | ||
56084 | /** | ||
56085 | * Matcher for detecting tuples t where []type attribute Function(source,target) | ||
56086 | */ | ||
56087 | private pattern mustInRelationtype_attribute_Function( | ||
56088 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
56089 | source: DefinedElement, target:DefinedElement) | ||
56090 | { | ||
56091 | find interpretation(problem,interpretation); | ||
56092 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
56093 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"type attribute Function"); | ||
56094 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
56095 | BinaryElementRelationLink.param1(link,source); | ||
56096 | BinaryElementRelationLink.param2(link,target); | ||
56097 | } | ||
56098 | /** | ||
56099 | * Matcher for detecting tuples t where <>type attribute Function(source,target) | ||
56100 | */ | ||
56101 | private pattern mayInRelationtype_attribute_Function( | ||
56102 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
56103 | source: DefinedElement, target:DefinedElement) | ||
56104 | { | ||
56105 | find interpretation(problem,interpretation); | ||
56106 | // The two endpoint of the link have to exist | ||
56107 | find mayExist(problem, interpretation, source); | ||
56108 | find mayExist(problem, interpretation, target); | ||
56109 | // Type consistency | ||
56110 | find mayInstanceOfFunction_class(problem,interpretation,source); | ||
56111 | find mayInstanceOfFunctionType_enum(problem,interpretation,target); | ||
56112 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
56113 | // the upper bound of the multiplicity should be considered. | ||
56114 | numberOfExistingReferences == count find mustInRelationtype_attribute_Function(problem,interpretation,source,_); | ||
56115 | check(numberOfExistingReferences < 1); | ||
56116 | } or { | ||
56117 | find mustInRelationtype_attribute_Function(problem,interpretation,source,target); | ||
56118 | } | ||
56119 | |||
56120 | ////////// | ||
56121 | // 1.3 Relation Definition Indexers | ||
56122 | ////////// | ||
56123 | |||
56124 | ////////// | ||
56125 | // 1.4 Containment Indexer | ||
56126 | ////////// | ||
56127 | private pattern mustContains2(source: DefinedElement, target: DefinedElement) { | ||
56128 | find mustContains4(_,_,source,target); | ||
56129 | } | ||
56130 | |||
56131 | private pattern mustContains4(problem:LogicProblem, interpretation:PartialInterpretation, | ||
56132 | source: DefinedElement, target: DefinedElement) | ||
56133 | { find mustInRelationinterface_reference_FunctionalElement(problem,interpretation,source,target); }or | ||
56134 | |||
56135 | { find mustInRelationrootElements_reference_FunctionalArchitectureModel(problem,interpretation,source,target); }or | ||
56136 | |||
56137 | { find mustInRelationsubElements_reference_Function(problem,interpretation,source,target); }or | ||
56138 | |||
56139 | { find mustInRelationdata_reference_FunctionalInterface(problem,interpretation,source,target); }or | ||
56140 | |||
56141 | { find mustInRelationoutgoingLinks_reference_FunctionalOutput(problem,interpretation,source,target); }or | ||
56142 | |||
56143 | { find mustInRelationterminator_reference_FunctionalData(problem,interpretation,source,target); } | ||
56144 | |||
56145 | private pattern mustTransitiveContains(source,target) { | ||
56146 | find mustContains2+(source,target); | ||
56147 | } | ||
56148 | |||
56149 | ////////// | ||
56150 | // 2. Invalidation Indexers | ||
56151 | ////////// | ||
56152 | // 2.1 Invalidated by WF Queries | ||
56153 | ////////// | ||
56154 | |||
56155 | ////////// | ||
56156 | // 3. Unfinishedness Indexers | ||
56157 | ////////// | ||
56158 | // 3.1 Unfinishedness Measured by Multiplicity | ||
56159 | ////////// | ||
56160 | pattern unfinishedLowerMultiplicity_model_reference_FunctionalElement(problem:LogicProblem, interpretation:PartialInterpretation, relationIterpretation:PartialRelationInterpretation, object:DefinedElement,missingMultiplicity) { | ||
56161 | find interpretation(problem,interpretation); | ||
56162 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
56163 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"model reference FunctionalElement"); | ||
56164 | find mustInstanceOfFunctionalElement_class(problem,interpretation,object); | ||
56165 | numberOfExistingReferences == count find mustInRelationmodel_reference_FunctionalElement(problem,interpretation,object,_); | ||
56166 | check(numberOfExistingReferences < 1); | ||
56167 | missingMultiplicity == eval(1-numberOfExistingReferences); | ||
56168 | } | ||
56169 | pattern unfinishedLowerMultiplicity_to_reference_InformationLink(problem:LogicProblem, interpretation:PartialInterpretation, relationIterpretation:PartialRelationInterpretation, object:DefinedElement,missingMultiplicity) { | ||
56170 | find interpretation(problem,interpretation); | ||
56171 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
56172 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"to reference InformationLink"); | ||
56173 | find mustInstanceOfInformationLink_class(problem,interpretation,object); | ||
56174 | numberOfExistingReferences == count find mustInRelationto_reference_InformationLink(problem,interpretation,object,_); | ||
56175 | check(numberOfExistingReferences < 1); | ||
56176 | missingMultiplicity == eval(1-numberOfExistingReferences); | ||
56177 | } | ||
56178 | pattern unfinishedLowerMultiplicity_type_attribute_Function(problem:LogicProblem, interpretation:PartialInterpretation, relationIterpretation:PartialRelationInterpretation, object:DefinedElement,missingMultiplicity) { | ||
56179 | find interpretation(problem,interpretation); | ||
56180 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
56181 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"type attribute Function"); | ||
56182 | find mustInstanceOfFunction_class(problem,interpretation,object); | ||
56183 | numberOfExistingReferences == count find mustInRelationtype_attribute_Function(problem,interpretation,object,_); | ||
56184 | check(numberOfExistingReferences < 1); | ||
56185 | missingMultiplicity == eval(1-numberOfExistingReferences); | ||
56186 | } | ||
56187 | |||
56188 | ////////// | ||
56189 | // 3.2 Unfinishedness Measured by WF Queries | ||
56190 | ////////// | ||
56191 | |||
56192 | ////////// | ||
56193 | // 4. Refinement Indexers | ||
56194 | ////////// | ||
56195 | // 4.1 Object constructors | ||
56196 | ////////// | ||
56197 | private pattern hasElementInContainment(problem:LogicProblem, interpretation:PartialInterpretation) | ||
56198 | { | ||
56199 | find interpretation(problem,interpretation); | ||
56200 | find mustInstanceOfFunctionalData_class(problem,interpretation,root); | ||
56201 | find mustExist(problem, interpretation, root); | ||
56202 | }or{ | ||
56203 | find interpretation(problem,interpretation); | ||
56204 | find mustInstanceOfFunctionalInterface_class(problem,interpretation,root); | ||
56205 | find mustExist(problem, interpretation, root); | ||
56206 | }or{ | ||
56207 | find interpretation(problem,interpretation); | ||
56208 | find mustInstanceOfFAMTerminator_class(problem,interpretation,root); | ||
56209 | find mustExist(problem, interpretation, root); | ||
56210 | }or{ | ||
56211 | find interpretation(problem,interpretation); | ||
56212 | find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,root); | ||
56213 | find mustExist(problem, interpretation, root); | ||
56214 | }or{ | ||
56215 | find interpretation(problem,interpretation); | ||
56216 | find mustInstanceOfFunctionalOutput_class(problem,interpretation,root); | ||
56217 | find mustExist(problem, interpretation, root); | ||
56218 | }or{ | ||
56219 | find interpretation(problem,interpretation); | ||
56220 | find mustInstanceOfFunctionalInput_class(problem,interpretation,root); | ||
56221 | find mustExist(problem, interpretation, root); | ||
56222 | }or{ | ||
56223 | find interpretation(problem,interpretation); | ||
56224 | find mustInstanceOfFunctionalElement_class(problem,interpretation,root); | ||
56225 | find mustExist(problem, interpretation, root); | ||
56226 | }or{ | ||
56227 | find interpretation(problem,interpretation); | ||
56228 | find mustInstanceOfFunction_class(problem,interpretation,root); | ||
56229 | find mustExist(problem, interpretation, root); | ||
56230 | }or{ | ||
56231 | find interpretation(problem,interpretation); | ||
56232 | find mustInstanceOfInformationLink_class(problem,interpretation,root); | ||
56233 | find mustExist(problem, interpretation, root); | ||
56234 | } | ||
56235 | pattern createObject_FunctionalArchitectureModel_class( | ||
56236 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
56237 | typeInterpretation:PartialComplexTypeInterpretation) | ||
56238 | { | ||
56239 | find interpretation(problem,interpretation); | ||
56240 | neg find hasElementInContainment(problem,interpretation); | ||
56241 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
56242 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalArchitectureModel class"); | ||
56243 | find mayInstanceOfFunctionalArchitectureModel_class(problem,interpretation,newObject); | ||
56244 | find mayExist(problem, interpretation, newObject); | ||
56245 | neg find mustExist(problem, interpretation, newObject); | ||
56246 | } | ||
56247 | pattern createObject_FunctionalInterface_class_by_interface_reference_FunctionalElement_with_element_reference_FunctionalInterface( | ||
56248 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
56249 | relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
56250 | container:DefinedElement) | ||
56251 | { | ||
56252 | find interpretation(problem,interpretation); | ||
56253 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
56254 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalInterface class"); | ||
56255 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
56256 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"interface reference FunctionalElement"); | ||
56257 | PartialInterpretation.partialrelationinterpretation(interpretation,inverseInterpretation); | ||
56258 | PartialRelationInterpretation.interpretationOf.name(inverseInterpretation,"element reference FunctionalInterface"); | ||
56259 | find mustInstanceOfFunctionalElement_class(problem,interpretation,container); | ||
56260 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,newObject); | ||
56261 | find mayInRelationinterface_reference_FunctionalElement(problem,interpretation,container,newObject); | ||
56262 | find mustExist(problem, interpretation, container); | ||
56263 | neg find mustExist(problem, interpretation, newObject); | ||
56264 | } | ||
56265 | pattern createObject_FunctionalInterface_class( | ||
56266 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
56267 | typeInterpretation:PartialComplexTypeInterpretation) | ||
56268 | { | ||
56269 | find interpretation(problem,interpretation); | ||
56270 | neg find hasElementInContainment(problem,interpretation); | ||
56271 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
56272 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalInterface class"); | ||
56273 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,newObject); | ||
56274 | find mayExist(problem, interpretation, newObject); | ||
56275 | neg find mustExist(problem, interpretation, newObject); | ||
56276 | } | ||
56277 | pattern createObject_Function_class_by_rootElements_reference_FunctionalArchitectureModel( | ||
56278 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
56279 | relationInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
56280 | container:DefinedElement) | ||
56281 | { | ||
56282 | find interpretation(problem,interpretation); | ||
56283 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
56284 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"Function class"); | ||
56285 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
56286 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"rootElements reference FunctionalArchitectureModel"); | ||
56287 | find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,container); | ||
56288 | find mayInstanceOfFunction_class(problem,interpretation,newObject); | ||
56289 | find mayInRelationrootElements_reference_FunctionalArchitectureModel(problem,interpretation,container,newObject); | ||
56290 | find mustExist(problem, interpretation, container); | ||
56291 | neg find mustExist(problem, interpretation, newObject); | ||
56292 | } | ||
56293 | pattern createObject_Function_class_by_subElements_reference_Function_with_parent_reference_FunctionalElement( | ||
56294 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
56295 | relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
56296 | container:DefinedElement) | ||
56297 | { | ||
56298 | find interpretation(problem,interpretation); | ||
56299 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
56300 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"Function class"); | ||
56301 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
56302 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"subElements reference Function"); | ||
56303 | PartialInterpretation.partialrelationinterpretation(interpretation,inverseInterpretation); | ||
56304 | PartialRelationInterpretation.interpretationOf.name(inverseInterpretation,"parent reference FunctionalElement"); | ||
56305 | find mustInstanceOfFunction_class(problem,interpretation,container); | ||
56306 | find mayInstanceOfFunction_class(problem,interpretation,newObject); | ||
56307 | find mayInRelationsubElements_reference_Function(problem,interpretation,container,newObject); | ||
56308 | find mustExist(problem, interpretation, container); | ||
56309 | neg find mustExist(problem, interpretation, newObject); | ||
56310 | } | ||
56311 | pattern createObject_Function_class( | ||
56312 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
56313 | typeInterpretation:PartialComplexTypeInterpretation) | ||
56314 | { | ||
56315 | find interpretation(problem,interpretation); | ||
56316 | neg find hasElementInContainment(problem,interpretation); | ||
56317 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
56318 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"Function class"); | ||
56319 | find mayInstanceOfFunction_class(problem,interpretation,newObject); | ||
56320 | find mayExist(problem, interpretation, newObject); | ||
56321 | neg find mustExist(problem, interpretation, newObject); | ||
56322 | } | ||
56323 | pattern createObject_FunctionalOutput_class_by_data_reference_FunctionalInterface_with_interface_reference_FunctionalData( | ||
56324 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
56325 | relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
56326 | container:DefinedElement) | ||
56327 | { | ||
56328 | find interpretation(problem,interpretation); | ||
56329 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
56330 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalOutput class"); | ||
56331 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
56332 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"data reference FunctionalInterface"); | ||
56333 | PartialInterpretation.partialrelationinterpretation(interpretation,inverseInterpretation); | ||
56334 | PartialRelationInterpretation.interpretationOf.name(inverseInterpretation,"interface reference FunctionalData"); | ||
56335 | find mustInstanceOfFunctionalInterface_class(problem,interpretation,container); | ||
56336 | find mayInstanceOfFunctionalOutput_class(problem,interpretation,newObject); | ||
56337 | find mayInRelationdata_reference_FunctionalInterface(problem,interpretation,container,newObject); | ||
56338 | find mustExist(problem, interpretation, container); | ||
56339 | neg find mustExist(problem, interpretation, newObject); | ||
56340 | } | ||
56341 | pattern createObject_FunctionalOutput_class( | ||
56342 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
56343 | typeInterpretation:PartialComplexTypeInterpretation) | ||
56344 | { | ||
56345 | find interpretation(problem,interpretation); | ||
56346 | neg find hasElementInContainment(problem,interpretation); | ||
56347 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
56348 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalOutput class"); | ||
56349 | find mayInstanceOfFunctionalOutput_class(problem,interpretation,newObject); | ||
56350 | find mayExist(problem, interpretation, newObject); | ||
56351 | neg find mustExist(problem, interpretation, newObject); | ||
56352 | } | ||
56353 | pattern createObject_InformationLink_class_by_outgoingLinks_reference_FunctionalOutput_with_from_reference_InformationLink( | ||
56354 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
56355 | relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
56356 | container:DefinedElement) | ||
56357 | { | ||
56358 | find interpretation(problem,interpretation); | ||
56359 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
56360 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"InformationLink class"); | ||
56361 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
56362 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"outgoingLinks reference FunctionalOutput"); | ||
56363 | PartialInterpretation.partialrelationinterpretation(interpretation,inverseInterpretation); | ||
56364 | PartialRelationInterpretation.interpretationOf.name(inverseInterpretation,"from reference InformationLink"); | ||
56365 | find mustInstanceOfFunctionalOutput_class(problem,interpretation,container); | ||
56366 | find mayInstanceOfInformationLink_class(problem,interpretation,newObject); | ||
56367 | find mayInRelationoutgoingLinks_reference_FunctionalOutput(problem,interpretation,container,newObject); | ||
56368 | find mustExist(problem, interpretation, container); | ||
56369 | neg find mustExist(problem, interpretation, newObject); | ||
56370 | } | ||
56371 | pattern createObject_InformationLink_class( | ||
56372 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
56373 | typeInterpretation:PartialComplexTypeInterpretation) | ||
56374 | { | ||
56375 | find interpretation(problem,interpretation); | ||
56376 | neg find hasElementInContainment(problem,interpretation); | ||
56377 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
56378 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"InformationLink class"); | ||
56379 | find mayInstanceOfInformationLink_class(problem,interpretation,newObject); | ||
56380 | find mayExist(problem, interpretation, newObject); | ||
56381 | neg find mustExist(problem, interpretation, newObject); | ||
56382 | } | ||
56383 | pattern createObject_FAMTerminator_class_by_terminator_reference_FunctionalData_with_data_reference_FAMTerminator( | ||
56384 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
56385 | relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
56386 | container:DefinedElement) | ||
56387 | { | ||
56388 | find interpretation(problem,interpretation); | ||
56389 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
56390 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FAMTerminator class"); | ||
56391 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
56392 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"terminator reference FunctionalData"); | ||
56393 | PartialInterpretation.partialrelationinterpretation(interpretation,inverseInterpretation); | ||
56394 | PartialRelationInterpretation.interpretationOf.name(inverseInterpretation,"data reference FAMTerminator"); | ||
56395 | find mustInstanceOfFunctionalData_class(problem,interpretation,container); | ||
56396 | find mayInstanceOfFAMTerminator_class(problem,interpretation,newObject); | ||
56397 | find mayInRelationterminator_reference_FunctionalData(problem,interpretation,container,newObject); | ||
56398 | find mustExist(problem, interpretation, container); | ||
56399 | neg find mustExist(problem, interpretation, newObject); | ||
56400 | } | ||
56401 | pattern createObject_FAMTerminator_class( | ||
56402 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
56403 | typeInterpretation:PartialComplexTypeInterpretation) | ||
56404 | { | ||
56405 | find interpretation(problem,interpretation); | ||
56406 | neg find hasElementInContainment(problem,interpretation); | ||
56407 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
56408 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FAMTerminator class"); | ||
56409 | find mayInstanceOfFAMTerminator_class(problem,interpretation,newObject); | ||
56410 | find mayExist(problem, interpretation, newObject); | ||
56411 | neg find mustExist(problem, interpretation, newObject); | ||
56412 | } | ||
56413 | pattern createObject_FunctionalInput_class_by_data_reference_FunctionalInterface_with_interface_reference_FunctionalData( | ||
56414 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
56415 | relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
56416 | container:DefinedElement) | ||
56417 | { | ||
56418 | find interpretation(problem,interpretation); | ||
56419 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
56420 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalInput class"); | ||
56421 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
56422 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"data reference FunctionalInterface"); | ||
56423 | PartialInterpretation.partialrelationinterpretation(interpretation,inverseInterpretation); | ||
56424 | PartialRelationInterpretation.interpretationOf.name(inverseInterpretation,"interface reference FunctionalData"); | ||
56425 | find mustInstanceOfFunctionalInterface_class(problem,interpretation,container); | ||
56426 | find mayInstanceOfFunctionalInput_class(problem,interpretation,newObject); | ||
56427 | find mayInRelationdata_reference_FunctionalInterface(problem,interpretation,container,newObject); | ||
56428 | find mustExist(problem, interpretation, container); | ||
56429 | neg find mustExist(problem, interpretation, newObject); | ||
56430 | } | ||
56431 | pattern createObject_FunctionalInput_class( | ||
56432 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
56433 | typeInterpretation:PartialComplexTypeInterpretation) | ||
56434 | { | ||
56435 | find interpretation(problem,interpretation); | ||
56436 | neg find hasElementInContainment(problem,interpretation); | ||
56437 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
56438 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalInput class"); | ||
56439 | find mayInstanceOfFunctionalInput_class(problem,interpretation,newObject); | ||
56440 | find mayExist(problem, interpretation, newObject); | ||
56441 | neg find mustExist(problem, interpretation, newObject); | ||
56442 | } | ||
56443 | |||
56444 | ////////// | ||
56445 | // 4.2 Type refinement | ||
56446 | ////////// | ||
56447 | pattern refineTypeTo_FunctionalArchitectureModel_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
56448 | find interpretation(problem,interpretation); | ||
56449 | PartialInterpretation.newElements(interpretation,element); | ||
56450 | find mayInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
56451 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
56452 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
56453 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
56454 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
56455 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
56456 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
56457 | } | ||
56458 | pattern refineTypeTo_FunctionalInterface_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
56459 | find interpretation(problem,interpretation); | ||
56460 | PartialInterpretation.newElements(interpretation,element); | ||
56461 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
56462 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
56463 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
56464 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
56465 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
56466 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
56467 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
56468 | } | ||
56469 | pattern refineTypeTo_Function_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
56470 | find interpretation(problem,interpretation); | ||
56471 | PartialInterpretation.newElements(interpretation,element); | ||
56472 | find mayInstanceOfFunction_class(problem,interpretation,element); | ||
56473 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
56474 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
56475 | neg find mustInstanceOfFunction_class(problem,interpretation,element); | ||
56476 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
56477 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
56478 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
56479 | } | ||
56480 | pattern refineTypeTo_FunctionalOutput_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
56481 | find interpretation(problem,interpretation); | ||
56482 | PartialInterpretation.newElements(interpretation,element); | ||
56483 | find mayInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
56484 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
56485 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
56486 | neg find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
56487 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
56488 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
56489 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
56490 | neg find mustInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
56491 | } | ||
56492 | pattern refineTypeTo_InformationLink_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
56493 | find interpretation(problem,interpretation); | ||
56494 | PartialInterpretation.newElements(interpretation,element); | ||
56495 | find mayInstanceOfInformationLink_class(problem,interpretation,element); | ||
56496 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
56497 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
56498 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
56499 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
56500 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
56501 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
56502 | } | ||
56503 | pattern refineTypeTo_FAMTerminator_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
56504 | find interpretation(problem,interpretation); | ||
56505 | PartialInterpretation.newElements(interpretation,element); | ||
56506 | find mayInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
56507 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
56508 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
56509 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
56510 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
56511 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
56512 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
56513 | } | ||
56514 | pattern refineTypeTo_FunctionalInput_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
56515 | find interpretation(problem,interpretation); | ||
56516 | PartialInterpretation.newElements(interpretation,element); | ||
56517 | find mayInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
56518 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
56519 | neg find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
56520 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
56521 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
56522 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
56523 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
56524 | neg find mustInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
56525 | } | ||
56526 | |||
56527 | ////////// | ||
56528 | // 4.3 Relation refinement | ||
56529 | ////////// | ||
56530 | pattern refineRelation_model_reference_FunctionalElement( | ||
56531 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
56532 | relationIterpretation:PartialRelationInterpretation, | ||
56533 | from: DefinedElement, to: DefinedElement) | ||
56534 | { | ||
56535 | find interpretation(problem,interpretation); | ||
56536 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
56537 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"model reference FunctionalElement"); | ||
56538 | find mustExist(problem, interpretation, from); | ||
56539 | find mustExist(problem, interpretation, to); | ||
56540 | find mustInstanceOfFunctionalElement_class(problem,interpretation,from); | ||
56541 | find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,to); | ||
56542 | find mayInRelationmodel_reference_FunctionalElement(problem,interpretation,from,to); | ||
56543 | neg find mustInRelationmodel_reference_FunctionalElement(problem,interpretation,from,to); | ||
56544 | } | ||
56545 | pattern refineRelation_IncomingLinks_reference_FunctionalInput_and_to_reference_InformationLink( | ||
56546 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
56547 | relationIterpretation:PartialRelationInterpretation, oppositeInterpretation:PartialRelationInterpretation, | ||
56548 | from: DefinedElement, to: DefinedElement) | ||
56549 | { | ||
56550 | find interpretation(problem,interpretation); | ||
56551 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
56552 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"IncomingLinks reference FunctionalInput"); | ||
56553 | PartialInterpretation.partialrelationinterpretation(interpretation,oppositeInterpretation); | ||
56554 | PartialRelationInterpretation.interpretationOf.name(oppositeInterpretation,"to reference InformationLink"); | ||
56555 | find mustExist(problem, interpretation, from); | ||
56556 | find mustExist(problem, interpretation, to); | ||
56557 | find mustInstanceOfFunctionalInput_class(problem,interpretation,from); | ||
56558 | find mustInstanceOfInformationLink_class(problem,interpretation,to); | ||
56559 | find mayInRelationIncomingLinks_reference_FunctionalInput(problem,interpretation,from,to); | ||
56560 | neg find mustInRelationIncomingLinks_reference_FunctionalInput(problem,interpretation,from,to); | ||
56561 | } | ||
56562 | pattern refineRelation_type_attribute_Function( | ||
56563 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
56564 | relationIterpretation:PartialRelationInterpretation, | ||
56565 | from: DefinedElement, to: DefinedElement) | ||
56566 | { | ||
56567 | find interpretation(problem,interpretation); | ||
56568 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
56569 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"type attribute Function"); | ||
56570 | find mustExist(problem, interpretation, from); | ||
56571 | find mustExist(problem, interpretation, to); | ||
56572 | find mustInstanceOfFunction_class(problem,interpretation,from); | ||
56573 | find mustInstanceOfFunctionType_enum(problem,interpretation,to); | ||
56574 | find mayInRelationtype_attribute_Function(problem,interpretation,from,to); | ||
56575 | neg find mustInRelationtype_attribute_Function(problem,interpretation,from,to); | ||
56576 | } | ||
56577 | import epackage "http://www.bme.hu/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage" | ||
56578 | import epackage "http://www.bme.hu/mit/inf/dslreasoner/logic/model/problem" | ||
56579 | import epackage "http://www.bme.hu/mit/inf/dslreasoner/logic/model/language" | ||
56580 | |||
56581 | ////////// | ||
56582 | // 0. Util | ||
56583 | ////////// | ||
56584 | private pattern interpretation(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
56585 | PartialInterpretation.problem(interpretation,problem); | ||
56586 | } | ||
56587 | |||
56588 | ///////////////////////// | ||
56589 | // 0.1 Existence | ||
56590 | ///////////////////////// | ||
56591 | private pattern mustExist(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
56592 | find interpretation(problem,interpretation); | ||
56593 | LogicProblem.elements(problem,element); | ||
56594 | } or { | ||
56595 | find interpretation(problem,interpretation); | ||
56596 | PartialInterpretation.newElements(interpretation,element); | ||
56597 | } | ||
56598 | |||
56599 | private pattern mayExist(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
56600 | find mustExist(problem,interpretation,element); | ||
56601 | } or { | ||
56602 | find interpretation(problem,interpretation); | ||
56603 | neg find elementCloseWorld(element); | ||
56604 | PartialInterpretation.openWorldElements(interpretation,element); | ||
56605 | } | ||
56606 | |||
56607 | private pattern elementCloseWorld(element:DefinedElement) { | ||
56608 | PartialInterpretation.openWorldElements(i,element); | ||
56609 | PartialInterpretation.maxNewElements(i,0); | ||
56610 | } or { | ||
56611 | Scope.targetTypeInterpretation(scope,interpretation); | ||
56612 | PartialTypeInterpratation.elements(interpretation,element); | ||
56613 | Scope.maxNewElements(scope,0); | ||
56614 | } | ||
56615 | |||
56616 | //////////////////////// | ||
56617 | // 0.2 Equivalence | ||
56618 | //////////////////////// | ||
56619 | pattern mayEquivalent(problem:LogicProblem, interpretation:PartialInterpretation, a: DefinedElement, b: DefinedElement) { | ||
56620 | find mayExist(problem,interpretation,a); | ||
56621 | find mayExist(problem,interpretation,b); | ||
56622 | a == b; | ||
56623 | } | ||
56624 | |||
56625 | //////////////////////// | ||
56626 | // 0.3 Required Patterns by TypeIndexer | ||
56627 | //////////////////////// | ||
56628 | private pattern typeInterpretation(problem:LogicProblem, interpretation:PartialInterpretation, type:TypeDeclaration, typeInterpretation:PartialComplexTypeInterpretation) { | ||
56629 | find interpretation(problem,interpretation); | ||
56630 | LogicProblem.types(problem,type); | ||
56631 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
56632 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
56633 | } | ||
56634 | |||
56635 | private pattern directInstanceOf(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement, type:Type) { | ||
56636 | find interpretation(problem,interpretation); | ||
56637 | LogicProblem.types(problem,type); | ||
56638 | TypeDefinition.elements(type,element); | ||
56639 | } or { | ||
56640 | find interpretation(problem,interpretation); | ||
56641 | find typeInterpretation(problem,interpretation,type,typeInterpretation); | ||
56642 | PartialComplexTypeInterpretation.elements(typeInterpretation,element); | ||
56643 | } | ||
56644 | |||
56645 | private pattern isPrimitive(element: PrimitiveElement) { | ||
56646 | PrimitiveElement(element); | ||
56647 | } | ||
56648 | |||
56649 | ////////// | ||
56650 | // 1. Problem-Specific Base Indexers | ||
56651 | ////////// | ||
56652 | // 1.1 Type Indexers | ||
56653 | ////////// | ||
56654 | // 1.1.1 primitive Type Indexers | ||
56655 | ////////// | ||
56656 | |||
56657 | ////////// | ||
56658 | // 1.1.2 domain-specific Type Indexers | ||
56659 | ////////// | ||
56660 | /** | ||
56661 | * An element must be an instance of type "FunctionalElement class". | ||
56662 | */ | ||
56663 | private pattern mustInstanceOfFunctionalElement_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
56664 | Type.name(type,"FunctionalElement class"); | ||
56665 | find directInstanceOf(problem,interpretation,element,type); | ||
56666 | } | ||
56667 | private pattern scopeDisallowsNewFunctionalElement_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
56668 | find interpretation(problem,interpretation); | ||
56669 | PartialInterpretation.scopes(interpretation,scope); | ||
56670 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
56671 | Scope.maxNewElements(scope,0); | ||
56672 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
56673 | Type.name(type,"FunctionalElement class"); | ||
56674 | } | ||
56675 | |||
56676 | /** | ||
56677 | * An element may be an instance of type "FunctionalElement class". | ||
56678 | */ | ||
56679 | private pattern mayInstanceOfFunctionalElement_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
56680 | { | ||
56681 | find interpretation(problem,interpretation); | ||
56682 | PartialInterpretation.newElements(interpretation,element); | ||
56683 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
56684 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
56685 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
56686 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
56687 | neg find mustInstanceOfFunction_class(problem,interpretation,element); | ||
56688 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
56689 | neg find scopeDisallowsNewFunctionalElement_class(problem, interpretation); | ||
56690 | neg find isPrimitive(element); | ||
56691 | } or { | ||
56692 | find interpretation(problem,interpretation); | ||
56693 | PartialInterpretation.openWorldElements(interpretation,element); | ||
56694 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
56695 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
56696 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
56697 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
56698 | neg find mustInstanceOfFunction_class(problem,interpretation,element); | ||
56699 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
56700 | neg find scopeDisallowsNewFunctionalElement_class(problem, interpretation); | ||
56701 | neg find isPrimitive(element); | ||
56702 | } or | ||
56703 | { find mustInstanceOfFunctionalElement_class(problem,interpretation,element); } | ||
56704 | /** | ||
56705 | * An element must be an instance of type "FunctionalArchitectureModel class". | ||
56706 | */ | ||
56707 | private pattern mustInstanceOfFunctionalArchitectureModel_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
56708 | Type.name(type,"FunctionalArchitectureModel class"); | ||
56709 | find directInstanceOf(problem,interpretation,element,type); | ||
56710 | } | ||
56711 | private pattern scopeDisallowsNewFunctionalArchitectureModel_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
56712 | find interpretation(problem,interpretation); | ||
56713 | PartialInterpretation.scopes(interpretation,scope); | ||
56714 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
56715 | Scope.maxNewElements(scope,0); | ||
56716 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
56717 | Type.name(type,"FunctionalArchitectureModel class"); | ||
56718 | } | ||
56719 | |||
56720 | /** | ||
56721 | * An element may be an instance of type "FunctionalArchitectureModel class". | ||
56722 | */ | ||
56723 | private pattern mayInstanceOfFunctionalArchitectureModel_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
56724 | { | ||
56725 | find interpretation(problem,interpretation); | ||
56726 | PartialInterpretation.newElements(interpretation,element); | ||
56727 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
56728 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
56729 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
56730 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
56731 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
56732 | neg find scopeDisallowsNewFunctionalArchitectureModel_class(problem, interpretation); | ||
56733 | neg find isPrimitive(element); | ||
56734 | } or { | ||
56735 | find interpretation(problem,interpretation); | ||
56736 | PartialInterpretation.openWorldElements(interpretation,element); | ||
56737 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
56738 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
56739 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
56740 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
56741 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
56742 | neg find scopeDisallowsNewFunctionalArchitectureModel_class(problem, interpretation); | ||
56743 | neg find isPrimitive(element); | ||
56744 | } or | ||
56745 | { find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); } | ||
56746 | /** | ||
56747 | * An element must be an instance of type "Function class". | ||
56748 | */ | ||
56749 | private pattern mustInstanceOfFunction_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
56750 | Type.name(type,"Function class"); | ||
56751 | find directInstanceOf(problem,interpretation,element,type); | ||
56752 | } | ||
56753 | private pattern scopeDisallowsNewFunction_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
56754 | find interpretation(problem,interpretation); | ||
56755 | PartialInterpretation.scopes(interpretation,scope); | ||
56756 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
56757 | Scope.maxNewElements(scope,0); | ||
56758 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
56759 | Type.name(type,"Function class"); | ||
56760 | } | ||
56761 | |||
56762 | /** | ||
56763 | * An element may be an instance of type "Function class". | ||
56764 | */ | ||
56765 | private pattern mayInstanceOfFunction_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
56766 | { | ||
56767 | find interpretation(problem,interpretation); | ||
56768 | PartialInterpretation.newElements(interpretation,element); | ||
56769 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
56770 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
56771 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
56772 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
56773 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
56774 | neg find scopeDisallowsNewFunction_class(problem, interpretation); | ||
56775 | neg find isPrimitive(element); | ||
56776 | } or { | ||
56777 | find interpretation(problem,interpretation); | ||
56778 | PartialInterpretation.openWorldElements(interpretation,element); | ||
56779 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
56780 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
56781 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
56782 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
56783 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
56784 | neg find scopeDisallowsNewFunction_class(problem, interpretation); | ||
56785 | neg find isPrimitive(element); | ||
56786 | } or | ||
56787 | { find mustInstanceOfFunction_class(problem,interpretation,element); } | ||
56788 | /** | ||
56789 | * An element must be an instance of type "FAMTerminator class". | ||
56790 | */ | ||
56791 | private pattern mustInstanceOfFAMTerminator_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
56792 | Type.name(type,"FAMTerminator class"); | ||
56793 | find directInstanceOf(problem,interpretation,element,type); | ||
56794 | } | ||
56795 | private pattern scopeDisallowsNewFAMTerminator_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
56796 | find interpretation(problem,interpretation); | ||
56797 | PartialInterpretation.scopes(interpretation,scope); | ||
56798 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
56799 | Scope.maxNewElements(scope,0); | ||
56800 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
56801 | Type.name(type,"FAMTerminator class"); | ||
56802 | } | ||
56803 | |||
56804 | /** | ||
56805 | * An element may be an instance of type "FAMTerminator class". | ||
56806 | */ | ||
56807 | private pattern mayInstanceOfFAMTerminator_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
56808 | { | ||
56809 | find interpretation(problem,interpretation); | ||
56810 | PartialInterpretation.newElements(interpretation,element); | ||
56811 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
56812 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
56813 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
56814 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
56815 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
56816 | neg find scopeDisallowsNewFAMTerminator_class(problem, interpretation); | ||
56817 | neg find isPrimitive(element); | ||
56818 | } or { | ||
56819 | find interpretation(problem,interpretation); | ||
56820 | PartialInterpretation.openWorldElements(interpretation,element); | ||
56821 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
56822 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
56823 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
56824 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
56825 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
56826 | neg find scopeDisallowsNewFAMTerminator_class(problem, interpretation); | ||
56827 | neg find isPrimitive(element); | ||
56828 | } or | ||
56829 | { find mustInstanceOfFAMTerminator_class(problem,interpretation,element); } | ||
56830 | /** | ||
56831 | * An element must be an instance of type "InformationLink class". | ||
56832 | */ | ||
56833 | private pattern mustInstanceOfInformationLink_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
56834 | Type.name(type,"InformationLink class"); | ||
56835 | find directInstanceOf(problem,interpretation,element,type); | ||
56836 | } | ||
56837 | private pattern scopeDisallowsNewInformationLink_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
56838 | find interpretation(problem,interpretation); | ||
56839 | PartialInterpretation.scopes(interpretation,scope); | ||
56840 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
56841 | Scope.maxNewElements(scope,0); | ||
56842 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
56843 | Type.name(type,"InformationLink class"); | ||
56844 | } | ||
56845 | |||
56846 | /** | ||
56847 | * An element may be an instance of type "InformationLink class". | ||
56848 | */ | ||
56849 | private pattern mayInstanceOfInformationLink_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
56850 | { | ||
56851 | find interpretation(problem,interpretation); | ||
56852 | PartialInterpretation.newElements(interpretation,element); | ||
56853 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
56854 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
56855 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
56856 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
56857 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
56858 | neg find scopeDisallowsNewInformationLink_class(problem, interpretation); | ||
56859 | neg find isPrimitive(element); | ||
56860 | } or { | ||
56861 | find interpretation(problem,interpretation); | ||
56862 | PartialInterpretation.openWorldElements(interpretation,element); | ||
56863 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
56864 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
56865 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
56866 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
56867 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
56868 | neg find scopeDisallowsNewInformationLink_class(problem, interpretation); | ||
56869 | neg find isPrimitive(element); | ||
56870 | } or | ||
56871 | { find mustInstanceOfInformationLink_class(problem,interpretation,element); } | ||
56872 | /** | ||
56873 | * An element must be an instance of type "FunctionalInterface class". | ||
56874 | */ | ||
56875 | private pattern mustInstanceOfFunctionalInterface_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
56876 | Type.name(type,"FunctionalInterface class"); | ||
56877 | find directInstanceOf(problem,interpretation,element,type); | ||
56878 | } | ||
56879 | private pattern scopeDisallowsNewFunctionalInterface_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
56880 | find interpretation(problem,interpretation); | ||
56881 | PartialInterpretation.scopes(interpretation,scope); | ||
56882 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
56883 | Scope.maxNewElements(scope,0); | ||
56884 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
56885 | Type.name(type,"FunctionalInterface class"); | ||
56886 | } | ||
56887 | |||
56888 | /** | ||
56889 | * An element may be an instance of type "FunctionalInterface class". | ||
56890 | */ | ||
56891 | private pattern mayInstanceOfFunctionalInterface_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
56892 | { | ||
56893 | find interpretation(problem,interpretation); | ||
56894 | PartialInterpretation.newElements(interpretation,element); | ||
56895 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
56896 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
56897 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
56898 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
56899 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
56900 | neg find scopeDisallowsNewFunctionalInterface_class(problem, interpretation); | ||
56901 | neg find isPrimitive(element); | ||
56902 | } or { | ||
56903 | find interpretation(problem,interpretation); | ||
56904 | PartialInterpretation.openWorldElements(interpretation,element); | ||
56905 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
56906 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
56907 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
56908 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
56909 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
56910 | neg find scopeDisallowsNewFunctionalInterface_class(problem, interpretation); | ||
56911 | neg find isPrimitive(element); | ||
56912 | } or | ||
56913 | { find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); } | ||
56914 | /** | ||
56915 | * An element must be an instance of type "FunctionalInput class". | ||
56916 | */ | ||
56917 | private pattern mustInstanceOfFunctionalInput_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
56918 | Type.name(type,"FunctionalInput class"); | ||
56919 | find directInstanceOf(problem,interpretation,element,type); | ||
56920 | } | ||
56921 | private pattern scopeDisallowsNewFunctionalInput_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
56922 | find interpretation(problem,interpretation); | ||
56923 | PartialInterpretation.scopes(interpretation,scope); | ||
56924 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
56925 | Scope.maxNewElements(scope,0); | ||
56926 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
56927 | Type.name(type,"FunctionalInput class"); | ||
56928 | } | ||
56929 | |||
56930 | /** | ||
56931 | * An element may be an instance of type "FunctionalInput class". | ||
56932 | */ | ||
56933 | private pattern mayInstanceOfFunctionalInput_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
56934 | { | ||
56935 | find interpretation(problem,interpretation); | ||
56936 | PartialInterpretation.newElements(interpretation,element); | ||
56937 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
56938 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
56939 | neg find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
56940 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
56941 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
56942 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
56943 | neg find scopeDisallowsNewFunctionalInput_class(problem, interpretation); | ||
56944 | neg find isPrimitive(element); | ||
56945 | } or { | ||
56946 | find interpretation(problem,interpretation); | ||
56947 | PartialInterpretation.openWorldElements(interpretation,element); | ||
56948 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
56949 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
56950 | neg find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
56951 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
56952 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
56953 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
56954 | neg find scopeDisallowsNewFunctionalInput_class(problem, interpretation); | ||
56955 | neg find isPrimitive(element); | ||
56956 | } or | ||
56957 | { find mustInstanceOfFunctionalInput_class(problem,interpretation,element); } | ||
56958 | /** | ||
56959 | * An element must be an instance of type "FunctionalOutput class". | ||
56960 | */ | ||
56961 | private pattern mustInstanceOfFunctionalOutput_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
56962 | Type.name(type,"FunctionalOutput class"); | ||
56963 | find directInstanceOf(problem,interpretation,element,type); | ||
56964 | } | ||
56965 | private pattern scopeDisallowsNewFunctionalOutput_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
56966 | find interpretation(problem,interpretation); | ||
56967 | PartialInterpretation.scopes(interpretation,scope); | ||
56968 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
56969 | Scope.maxNewElements(scope,0); | ||
56970 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
56971 | Type.name(type,"FunctionalOutput class"); | ||
56972 | } | ||
56973 | |||
56974 | /** | ||
56975 | * An element may be an instance of type "FunctionalOutput class". | ||
56976 | */ | ||
56977 | private pattern mayInstanceOfFunctionalOutput_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
56978 | { | ||
56979 | find interpretation(problem,interpretation); | ||
56980 | PartialInterpretation.newElements(interpretation,element); | ||
56981 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
56982 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
56983 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
56984 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
56985 | neg find mustInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
56986 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
56987 | neg find scopeDisallowsNewFunctionalOutput_class(problem, interpretation); | ||
56988 | neg find isPrimitive(element); | ||
56989 | } or { | ||
56990 | find interpretation(problem,interpretation); | ||
56991 | PartialInterpretation.openWorldElements(interpretation,element); | ||
56992 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
56993 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
56994 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
56995 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
56996 | neg find mustInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
56997 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
56998 | neg find scopeDisallowsNewFunctionalOutput_class(problem, interpretation); | ||
56999 | neg find isPrimitive(element); | ||
57000 | } or | ||
57001 | { find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); } | ||
57002 | /** | ||
57003 | * An element must be an instance of type "FunctionalData class". | ||
57004 | */ | ||
57005 | private pattern mustInstanceOfFunctionalData_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
57006 | Type.name(type,"FunctionalData class"); | ||
57007 | find directInstanceOf(problem,interpretation,element,type); | ||
57008 | } | ||
57009 | private pattern scopeDisallowsNewFunctionalData_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
57010 | find interpretation(problem,interpretation); | ||
57011 | PartialInterpretation.scopes(interpretation,scope); | ||
57012 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
57013 | Scope.maxNewElements(scope,0); | ||
57014 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
57015 | Type.name(type,"FunctionalData class"); | ||
57016 | } | ||
57017 | |||
57018 | /** | ||
57019 | * An element may be an instance of type "FunctionalData class". | ||
57020 | */ | ||
57021 | private pattern mayInstanceOfFunctionalData_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
57022 | { | ||
57023 | find interpretation(problem,interpretation); | ||
57024 | PartialInterpretation.newElements(interpretation,element); | ||
57025 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
57026 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
57027 | neg find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
57028 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
57029 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
57030 | neg find mustInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
57031 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
57032 | neg find scopeDisallowsNewFunctionalData_class(problem, interpretation); | ||
57033 | neg find isPrimitive(element); | ||
57034 | } or { | ||
57035 | find interpretation(problem,interpretation); | ||
57036 | PartialInterpretation.openWorldElements(interpretation,element); | ||
57037 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
57038 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
57039 | neg find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
57040 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
57041 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
57042 | neg find mustInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
57043 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
57044 | neg find scopeDisallowsNewFunctionalData_class(problem, interpretation); | ||
57045 | neg find isPrimitive(element); | ||
57046 | } or | ||
57047 | { find mustInstanceOfFunctionalData_class(problem,interpretation,element); } | ||
57048 | /** | ||
57049 | * An element must be an instance of type "FunctionType enum". | ||
57050 | */ | ||
57051 | private pattern mustInstanceOfFunctionType_enum(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
57052 | Type.name(type,"FunctionType enum"); | ||
57053 | find directInstanceOf(problem,interpretation,element,type); | ||
57054 | } | ||
57055 | private pattern scopeDisallowsNewFunctionType_enum(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
57056 | find interpretation(problem,interpretation); | ||
57057 | PartialInterpretation.scopes(interpretation,scope); | ||
57058 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
57059 | Scope.maxNewElements(scope,0); | ||
57060 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
57061 | Type.name(type,"FunctionType enum"); | ||
57062 | } | ||
57063 | |||
57064 | /** | ||
57065 | * An element may be an instance of type "FunctionType enum". | ||
57066 | */ | ||
57067 | private pattern mayInstanceOfFunctionType_enum(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
57068 | { find mustInstanceOfFunctionType_enum(problem,interpretation,element); } | ||
57069 | |||
57070 | ////////// | ||
57071 | // 1.2 Relation Declaration Indexers | ||
57072 | ////////// | ||
57073 | /** | ||
57074 | * Matcher for detecting tuples t where []interface reference FunctionalElement(source,target) | ||
57075 | */ | ||
57076 | private pattern mustInRelationinterface_reference_FunctionalElement( | ||
57077 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
57078 | source: DefinedElement, target:DefinedElement) | ||
57079 | { | ||
57080 | find interpretation(problem,interpretation); | ||
57081 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
57082 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"interface reference FunctionalElement"); | ||
57083 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
57084 | BinaryElementRelationLink.param1(link,source); | ||
57085 | BinaryElementRelationLink.param2(link,target); | ||
57086 | } | ||
57087 | /** | ||
57088 | * Matcher for detecting tuples t where <>interface reference FunctionalElement(source,target) | ||
57089 | */ | ||
57090 | private pattern mayInRelationinterface_reference_FunctionalElement( | ||
57091 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
57092 | source: DefinedElement, target:DefinedElement) | ||
57093 | { | ||
57094 | find interpretation(problem,interpretation); | ||
57095 | // The two endpoint of the link have to exist | ||
57096 | find mayExist(problem, interpretation, source); | ||
57097 | find mayExist(problem, interpretation, target); | ||
57098 | // Type consistency | ||
57099 | find mayInstanceOfFunctionalElement_class(problem,interpretation,source); | ||
57100 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,target); | ||
57101 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
57102 | // the upper bound of the multiplicity should be considered. | ||
57103 | numberOfExistingReferences == count find mustInRelationinterface_reference_FunctionalElement(problem,interpretation,source,_); | ||
57104 | check(numberOfExistingReferences < 1); | ||
57105 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
57106 | // the upper bound of the opposite reference multiplicity should be considered. | ||
57107 | numberOfExistingOppositeReferences == count find mustInRelationelement_reference_FunctionalInterface(problem,interpretation,target,_); | ||
57108 | check(numberOfExistingOppositeReferences < 1); | ||
57109 | // The reference is containment, then a new reference cannot be create if: | ||
57110 | // 1. Multiple parents | ||
57111 | neg find mustContains4(problem,interpretation,_,target); | ||
57112 | // 2. Circle in the containment hierarchy | ||
57113 | neg find mustTransitiveContains(source,target); | ||
57114 | } or { | ||
57115 | find mustInRelationinterface_reference_FunctionalElement(problem,interpretation,source,target); | ||
57116 | } | ||
57117 | /** | ||
57118 | * Matcher for detecting tuples t where []model reference FunctionalElement(source,target) | ||
57119 | */ | ||
57120 | private pattern mustInRelationmodel_reference_FunctionalElement( | ||
57121 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
57122 | source: DefinedElement, target:DefinedElement) | ||
57123 | { | ||
57124 | find interpretation(problem,interpretation); | ||
57125 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
57126 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"model reference FunctionalElement"); | ||
57127 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
57128 | BinaryElementRelationLink.param1(link,source); | ||
57129 | BinaryElementRelationLink.param2(link,target); | ||
57130 | } | ||
57131 | /** | ||
57132 | * Matcher for detecting tuples t where <>model reference FunctionalElement(source,target) | ||
57133 | */ | ||
57134 | private pattern mayInRelationmodel_reference_FunctionalElement( | ||
57135 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
57136 | source: DefinedElement, target:DefinedElement) | ||
57137 | { | ||
57138 | find interpretation(problem,interpretation); | ||
57139 | // The two endpoint of the link have to exist | ||
57140 | find mayExist(problem, interpretation, source); | ||
57141 | find mayExist(problem, interpretation, target); | ||
57142 | // Type consistency | ||
57143 | find mayInstanceOfFunctionalElement_class(problem,interpretation,source); | ||
57144 | find mayInstanceOfFunctionalArchitectureModel_class(problem,interpretation,target); | ||
57145 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
57146 | // the upper bound of the multiplicity should be considered. | ||
57147 | numberOfExistingReferences == count find mustInRelationmodel_reference_FunctionalElement(problem,interpretation,source,_); | ||
57148 | check(numberOfExistingReferences < 1); | ||
57149 | } or { | ||
57150 | find mustInRelationmodel_reference_FunctionalElement(problem,interpretation,source,target); | ||
57151 | } | ||
57152 | /** | ||
57153 | * Matcher for detecting tuples t where []parent reference FunctionalElement(source,target) | ||
57154 | */ | ||
57155 | private pattern mustInRelationparent_reference_FunctionalElement( | ||
57156 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
57157 | source: DefinedElement, target:DefinedElement) | ||
57158 | { | ||
57159 | find interpretation(problem,interpretation); | ||
57160 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
57161 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"parent reference FunctionalElement"); | ||
57162 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
57163 | BinaryElementRelationLink.param1(link,source); | ||
57164 | BinaryElementRelationLink.param2(link,target); | ||
57165 | } | ||
57166 | /** | ||
57167 | * Matcher for detecting tuples t where <>parent reference FunctionalElement(source,target) | ||
57168 | */ | ||
57169 | private pattern mayInRelationparent_reference_FunctionalElement( | ||
57170 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
57171 | source: DefinedElement, target:DefinedElement) | ||
57172 | { | ||
57173 | find interpretation(problem,interpretation); | ||
57174 | // The two endpoint of the link have to exist | ||
57175 | find mayExist(problem, interpretation, source); | ||
57176 | find mayExist(problem, interpretation, target); | ||
57177 | // Type consistency | ||
57178 | find mayInstanceOfFunctionalElement_class(problem,interpretation,source); | ||
57179 | find mayInstanceOfFunction_class(problem,interpretation,target); | ||
57180 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
57181 | // the upper bound of the multiplicity should be considered. | ||
57182 | numberOfExistingReferences == count find mustInRelationparent_reference_FunctionalElement(problem,interpretation,source,_); | ||
57183 | check(numberOfExistingReferences < 1); | ||
57184 | // The eOpposite of the reference is containment, then a referene cannot be created if | ||
57185 | // 1. Multiple parents | ||
57186 | neg find mustContains4(problem,interpretation,source,_); | ||
57187 | // 2. Circle in the containment hierarchy | ||
57188 | neg find mustTransitiveContains(source,target); | ||
57189 | } or { | ||
57190 | find mustInRelationparent_reference_FunctionalElement(problem,interpretation,source,target); | ||
57191 | } | ||
57192 | /** | ||
57193 | * Matcher for detecting tuples t where []rootElements reference FunctionalArchitectureModel(source,target) | ||
57194 | */ | ||
57195 | private pattern mustInRelationrootElements_reference_FunctionalArchitectureModel( | ||
57196 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
57197 | source: DefinedElement, target:DefinedElement) | ||
57198 | { | ||
57199 | find interpretation(problem,interpretation); | ||
57200 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
57201 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"rootElements reference FunctionalArchitectureModel"); | ||
57202 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
57203 | BinaryElementRelationLink.param1(link,source); | ||
57204 | BinaryElementRelationLink.param2(link,target); | ||
57205 | } | ||
57206 | /** | ||
57207 | * Matcher for detecting tuples t where <>rootElements reference FunctionalArchitectureModel(source,target) | ||
57208 | */ | ||
57209 | private pattern mayInRelationrootElements_reference_FunctionalArchitectureModel( | ||
57210 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
57211 | source: DefinedElement, target:DefinedElement) | ||
57212 | { | ||
57213 | find interpretation(problem,interpretation); | ||
57214 | // The two endpoint of the link have to exist | ||
57215 | find mayExist(problem, interpretation, source); | ||
57216 | find mayExist(problem, interpretation, target); | ||
57217 | // Type consistency | ||
57218 | find mayInstanceOfFunctionalArchitectureModel_class(problem,interpretation,source); | ||
57219 | find mayInstanceOfFunctionalElement_class(problem,interpretation,target); | ||
57220 | // The reference is containment, then a new reference cannot be create if: | ||
57221 | // 1. Multiple parents | ||
57222 | neg find mustContains4(problem,interpretation,_,target); | ||
57223 | // 2. Circle in the containment hierarchy | ||
57224 | neg find mustTransitiveContains(source,target); | ||
57225 | } or { | ||
57226 | find mustInRelationrootElements_reference_FunctionalArchitectureModel(problem,interpretation,source,target); | ||
57227 | } | ||
57228 | /** | ||
57229 | * Matcher for detecting tuples t where []subElements reference Function(source,target) | ||
57230 | */ | ||
57231 | private pattern mustInRelationsubElements_reference_Function( | ||
57232 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
57233 | source: DefinedElement, target:DefinedElement) | ||
57234 | { | ||
57235 | find interpretation(problem,interpretation); | ||
57236 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
57237 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"subElements reference Function"); | ||
57238 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
57239 | BinaryElementRelationLink.param1(link,source); | ||
57240 | BinaryElementRelationLink.param2(link,target); | ||
57241 | } | ||
57242 | /** | ||
57243 | * Matcher for detecting tuples t where <>subElements reference Function(source,target) | ||
57244 | */ | ||
57245 | private pattern mayInRelationsubElements_reference_Function( | ||
57246 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
57247 | source: DefinedElement, target:DefinedElement) | ||
57248 | { | ||
57249 | find interpretation(problem,interpretation); | ||
57250 | // The two endpoint of the link have to exist | ||
57251 | find mayExist(problem, interpretation, source); | ||
57252 | find mayExist(problem, interpretation, target); | ||
57253 | // Type consistency | ||
57254 | find mayInstanceOfFunction_class(problem,interpretation,source); | ||
57255 | find mayInstanceOfFunctionalElement_class(problem,interpretation,target); | ||
57256 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
57257 | // the upper bound of the opposite reference multiplicity should be considered. | ||
57258 | numberOfExistingOppositeReferences == count find mustInRelationparent_reference_FunctionalElement(problem,interpretation,target,_); | ||
57259 | check(numberOfExistingOppositeReferences < 1); | ||
57260 | // The reference is containment, then a new reference cannot be create if: | ||
57261 | // 1. Multiple parents | ||
57262 | neg find mustContains4(problem,interpretation,_,target); | ||
57263 | // 2. Circle in the containment hierarchy | ||
57264 | neg find mustTransitiveContains(source,target); | ||
57265 | } or { | ||
57266 | find mustInRelationsubElements_reference_Function(problem,interpretation,source,target); | ||
57267 | } | ||
57268 | /** | ||
57269 | * Matcher for detecting tuples t where []data reference FAMTerminator(source,target) | ||
57270 | */ | ||
57271 | private pattern mustInRelationdata_reference_FAMTerminator( | ||
57272 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
57273 | source: DefinedElement, target:DefinedElement) | ||
57274 | { | ||
57275 | find interpretation(problem,interpretation); | ||
57276 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
57277 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"data reference FAMTerminator"); | ||
57278 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
57279 | BinaryElementRelationLink.param1(link,source); | ||
57280 | BinaryElementRelationLink.param2(link,target); | ||
57281 | } | ||
57282 | /** | ||
57283 | * Matcher for detecting tuples t where <>data reference FAMTerminator(source,target) | ||
57284 | */ | ||
57285 | private pattern mayInRelationdata_reference_FAMTerminator( | ||
57286 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
57287 | source: DefinedElement, target:DefinedElement) | ||
57288 | { | ||
57289 | find interpretation(problem,interpretation); | ||
57290 | // The two endpoint of the link have to exist | ||
57291 | find mayExist(problem, interpretation, source); | ||
57292 | find mayExist(problem, interpretation, target); | ||
57293 | // Type consistency | ||
57294 | find mayInstanceOfFAMTerminator_class(problem,interpretation,source); | ||
57295 | find mayInstanceOfFunctionalData_class(problem,interpretation,target); | ||
57296 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
57297 | // the upper bound of the multiplicity should be considered. | ||
57298 | numberOfExistingReferences == count find mustInRelationdata_reference_FAMTerminator(problem,interpretation,source,_); | ||
57299 | check(numberOfExistingReferences < 1); | ||
57300 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
57301 | // the upper bound of the opposite reference multiplicity should be considered. | ||
57302 | numberOfExistingOppositeReferences == count find mustInRelationterminator_reference_FunctionalData(problem,interpretation,target,_); | ||
57303 | check(numberOfExistingOppositeReferences < 1); | ||
57304 | // The eOpposite of the reference is containment, then a referene cannot be created if | ||
57305 | // 1. Multiple parents | ||
57306 | neg find mustContains4(problem,interpretation,source,_); | ||
57307 | // 2. Circle in the containment hierarchy | ||
57308 | neg find mustTransitiveContains(source,target); | ||
57309 | } or { | ||
57310 | find mustInRelationdata_reference_FAMTerminator(problem,interpretation,source,target); | ||
57311 | } | ||
57312 | /** | ||
57313 | * Matcher for detecting tuples t where []from reference InformationLink(source,target) | ||
57314 | */ | ||
57315 | private pattern mustInRelationfrom_reference_InformationLink( | ||
57316 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
57317 | source: DefinedElement, target:DefinedElement) | ||
57318 | { | ||
57319 | find interpretation(problem,interpretation); | ||
57320 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
57321 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"from reference InformationLink"); | ||
57322 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
57323 | BinaryElementRelationLink.param1(link,source); | ||
57324 | BinaryElementRelationLink.param2(link,target); | ||
57325 | } | ||
57326 | /** | ||
57327 | * Matcher for detecting tuples t where <>from reference InformationLink(source,target) | ||
57328 | */ | ||
57329 | private pattern mayInRelationfrom_reference_InformationLink( | ||
57330 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
57331 | source: DefinedElement, target:DefinedElement) | ||
57332 | { | ||
57333 | find interpretation(problem,interpretation); | ||
57334 | // The two endpoint of the link have to exist | ||
57335 | find mayExist(problem, interpretation, source); | ||
57336 | find mayExist(problem, interpretation, target); | ||
57337 | // Type consistency | ||
57338 | find mayInstanceOfInformationLink_class(problem,interpretation,source); | ||
57339 | find mayInstanceOfFunctionalOutput_class(problem,interpretation,target); | ||
57340 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
57341 | // the upper bound of the multiplicity should be considered. | ||
57342 | numberOfExistingReferences == count find mustInRelationfrom_reference_InformationLink(problem,interpretation,source,_); | ||
57343 | check(numberOfExistingReferences < 1); | ||
57344 | // The eOpposite of the reference is containment, then a referene cannot be created if | ||
57345 | // 1. Multiple parents | ||
57346 | neg find mustContains4(problem,interpretation,source,_); | ||
57347 | // 2. Circle in the containment hierarchy | ||
57348 | neg find mustTransitiveContains(source,target); | ||
57349 | } or { | ||
57350 | find mustInRelationfrom_reference_InformationLink(problem,interpretation,source,target); | ||
57351 | } | ||
57352 | /** | ||
57353 | * Matcher for detecting tuples t where []to reference InformationLink(source,target) | ||
57354 | */ | ||
57355 | private pattern mustInRelationto_reference_InformationLink( | ||
57356 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
57357 | source: DefinedElement, target:DefinedElement) | ||
57358 | { | ||
57359 | find interpretation(problem,interpretation); | ||
57360 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
57361 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"to reference InformationLink"); | ||
57362 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
57363 | BinaryElementRelationLink.param1(link,source); | ||
57364 | BinaryElementRelationLink.param2(link,target); | ||
57365 | } | ||
57366 | /** | ||
57367 | * Matcher for detecting tuples t where <>to reference InformationLink(source,target) | ||
57368 | */ | ||
57369 | private pattern mayInRelationto_reference_InformationLink( | ||
57370 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
57371 | source: DefinedElement, target:DefinedElement) | ||
57372 | { | ||
57373 | find interpretation(problem,interpretation); | ||
57374 | // The two endpoint of the link have to exist | ||
57375 | find mayExist(problem, interpretation, source); | ||
57376 | find mayExist(problem, interpretation, target); | ||
57377 | // Type consistency | ||
57378 | find mayInstanceOfInformationLink_class(problem,interpretation,source); | ||
57379 | find mayInstanceOfFunctionalInput_class(problem,interpretation,target); | ||
57380 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
57381 | // the upper bound of the multiplicity should be considered. | ||
57382 | numberOfExistingReferences == count find mustInRelationto_reference_InformationLink(problem,interpretation,source,_); | ||
57383 | check(numberOfExistingReferences < 1); | ||
57384 | } or { | ||
57385 | find mustInRelationto_reference_InformationLink(problem,interpretation,source,target); | ||
57386 | } | ||
57387 | /** | ||
57388 | * Matcher for detecting tuples t where []data reference FunctionalInterface(source,target) | ||
57389 | */ | ||
57390 | private pattern mustInRelationdata_reference_FunctionalInterface( | ||
57391 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
57392 | source: DefinedElement, target:DefinedElement) | ||
57393 | { | ||
57394 | find interpretation(problem,interpretation); | ||
57395 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
57396 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"data reference FunctionalInterface"); | ||
57397 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
57398 | BinaryElementRelationLink.param1(link,source); | ||
57399 | BinaryElementRelationLink.param2(link,target); | ||
57400 | } | ||
57401 | /** | ||
57402 | * Matcher for detecting tuples t where <>data reference FunctionalInterface(source,target) | ||
57403 | */ | ||
57404 | private pattern mayInRelationdata_reference_FunctionalInterface( | ||
57405 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
57406 | source: DefinedElement, target:DefinedElement) | ||
57407 | { | ||
57408 | find interpretation(problem,interpretation); | ||
57409 | // The two endpoint of the link have to exist | ||
57410 | find mayExist(problem, interpretation, source); | ||
57411 | find mayExist(problem, interpretation, target); | ||
57412 | // Type consistency | ||
57413 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,source); | ||
57414 | find mayInstanceOfFunctionalData_class(problem,interpretation,target); | ||
57415 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
57416 | // the upper bound of the opposite reference multiplicity should be considered. | ||
57417 | numberOfExistingOppositeReferences == count find mustInRelationinterface_reference_FunctionalData(problem,interpretation,target,_); | ||
57418 | check(numberOfExistingOppositeReferences < 1); | ||
57419 | // The reference is containment, then a new reference cannot be create if: | ||
57420 | // 1. Multiple parents | ||
57421 | neg find mustContains4(problem,interpretation,_,target); | ||
57422 | // 2. Circle in the containment hierarchy | ||
57423 | neg find mustTransitiveContains(source,target); | ||
57424 | } or { | ||
57425 | find mustInRelationdata_reference_FunctionalInterface(problem,interpretation,source,target); | ||
57426 | } | ||
57427 | /** | ||
57428 | * Matcher for detecting tuples t where []element reference FunctionalInterface(source,target) | ||
57429 | */ | ||
57430 | private pattern mustInRelationelement_reference_FunctionalInterface( | ||
57431 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
57432 | source: DefinedElement, target:DefinedElement) | ||
57433 | { | ||
57434 | find interpretation(problem,interpretation); | ||
57435 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
57436 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"element reference FunctionalInterface"); | ||
57437 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
57438 | BinaryElementRelationLink.param1(link,source); | ||
57439 | BinaryElementRelationLink.param2(link,target); | ||
57440 | } | ||
57441 | /** | ||
57442 | * Matcher for detecting tuples t where <>element reference FunctionalInterface(source,target) | ||
57443 | */ | ||
57444 | private pattern mayInRelationelement_reference_FunctionalInterface( | ||
57445 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
57446 | source: DefinedElement, target:DefinedElement) | ||
57447 | { | ||
57448 | find interpretation(problem,interpretation); | ||
57449 | // The two endpoint of the link have to exist | ||
57450 | find mayExist(problem, interpretation, source); | ||
57451 | find mayExist(problem, interpretation, target); | ||
57452 | // Type consistency | ||
57453 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,source); | ||
57454 | find mayInstanceOfFunctionalElement_class(problem,interpretation,target); | ||
57455 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
57456 | // the upper bound of the multiplicity should be considered. | ||
57457 | numberOfExistingReferences == count find mustInRelationelement_reference_FunctionalInterface(problem,interpretation,source,_); | ||
57458 | check(numberOfExistingReferences < 1); | ||
57459 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
57460 | // the upper bound of the opposite reference multiplicity should be considered. | ||
57461 | numberOfExistingOppositeReferences == count find mustInRelationinterface_reference_FunctionalElement(problem,interpretation,target,_); | ||
57462 | check(numberOfExistingOppositeReferences < 1); | ||
57463 | // The eOpposite of the reference is containment, then a referene cannot be created if | ||
57464 | // 1. Multiple parents | ||
57465 | neg find mustContains4(problem,interpretation,source,_); | ||
57466 | // 2. Circle in the containment hierarchy | ||
57467 | neg find mustTransitiveContains(source,target); | ||
57468 | } or { | ||
57469 | find mustInRelationelement_reference_FunctionalInterface(problem,interpretation,source,target); | ||
57470 | } | ||
57471 | /** | ||
57472 | * Matcher for detecting tuples t where []IncomingLinks reference FunctionalInput(source,target) | ||
57473 | */ | ||
57474 | private pattern mustInRelationIncomingLinks_reference_FunctionalInput( | ||
57475 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
57476 | source: DefinedElement, target:DefinedElement) | ||
57477 | { | ||
57478 | find interpretation(problem,interpretation); | ||
57479 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
57480 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"IncomingLinks reference FunctionalInput"); | ||
57481 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
57482 | BinaryElementRelationLink.param1(link,source); | ||
57483 | BinaryElementRelationLink.param2(link,target); | ||
57484 | } | ||
57485 | /** | ||
57486 | * Matcher for detecting tuples t where <>IncomingLinks reference FunctionalInput(source,target) | ||
57487 | */ | ||
57488 | private pattern mayInRelationIncomingLinks_reference_FunctionalInput( | ||
57489 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
57490 | source: DefinedElement, target:DefinedElement) | ||
57491 | { | ||
57492 | find interpretation(problem,interpretation); | ||
57493 | // The two endpoint of the link have to exist | ||
57494 | find mayExist(problem, interpretation, source); | ||
57495 | find mayExist(problem, interpretation, target); | ||
57496 | // Type consistency | ||
57497 | find mayInstanceOfFunctionalInput_class(problem,interpretation,source); | ||
57498 | find mayInstanceOfInformationLink_class(problem,interpretation,target); | ||
57499 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
57500 | // the upper bound of the opposite reference multiplicity should be considered. | ||
57501 | numberOfExistingOppositeReferences == count find mustInRelationto_reference_InformationLink(problem,interpretation,target,_); | ||
57502 | check(numberOfExistingOppositeReferences < 1); | ||
57503 | } or { | ||
57504 | find mustInRelationIncomingLinks_reference_FunctionalInput(problem,interpretation,source,target); | ||
57505 | } | ||
57506 | /** | ||
57507 | * Matcher for detecting tuples t where []outgoingLinks reference FunctionalOutput(source,target) | ||
57508 | */ | ||
57509 | private pattern mustInRelationoutgoingLinks_reference_FunctionalOutput( | ||
57510 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
57511 | source: DefinedElement, target:DefinedElement) | ||
57512 | { | ||
57513 | find interpretation(problem,interpretation); | ||
57514 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
57515 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"outgoingLinks reference FunctionalOutput"); | ||
57516 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
57517 | BinaryElementRelationLink.param1(link,source); | ||
57518 | BinaryElementRelationLink.param2(link,target); | ||
57519 | } | ||
57520 | /** | ||
57521 | * Matcher for detecting tuples t where <>outgoingLinks reference FunctionalOutput(source,target) | ||
57522 | */ | ||
57523 | private pattern mayInRelationoutgoingLinks_reference_FunctionalOutput( | ||
57524 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
57525 | source: DefinedElement, target:DefinedElement) | ||
57526 | { | ||
57527 | find interpretation(problem,interpretation); | ||
57528 | // The two endpoint of the link have to exist | ||
57529 | find mayExist(problem, interpretation, source); | ||
57530 | find mayExist(problem, interpretation, target); | ||
57531 | // Type consistency | ||
57532 | find mayInstanceOfFunctionalOutput_class(problem,interpretation,source); | ||
57533 | find mayInstanceOfInformationLink_class(problem,interpretation,target); | ||
57534 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
57535 | // the upper bound of the opposite reference multiplicity should be considered. | ||
57536 | numberOfExistingOppositeReferences == count find mustInRelationfrom_reference_InformationLink(problem,interpretation,target,_); | ||
57537 | check(numberOfExistingOppositeReferences < 1); | ||
57538 | // The reference is containment, then a new reference cannot be create if: | ||
57539 | // 1. Multiple parents | ||
57540 | neg find mustContains4(problem,interpretation,_,target); | ||
57541 | // 2. Circle in the containment hierarchy | ||
57542 | neg find mustTransitiveContains(source,target); | ||
57543 | } or { | ||
57544 | find mustInRelationoutgoingLinks_reference_FunctionalOutput(problem,interpretation,source,target); | ||
57545 | } | ||
57546 | /** | ||
57547 | * Matcher for detecting tuples t where []terminator reference FunctionalData(source,target) | ||
57548 | */ | ||
57549 | private pattern mustInRelationterminator_reference_FunctionalData( | ||
57550 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
57551 | source: DefinedElement, target:DefinedElement) | ||
57552 | { | ||
57553 | find interpretation(problem,interpretation); | ||
57554 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
57555 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"terminator reference FunctionalData"); | ||
57556 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
57557 | BinaryElementRelationLink.param1(link,source); | ||
57558 | BinaryElementRelationLink.param2(link,target); | ||
57559 | } | ||
57560 | /** | ||
57561 | * Matcher for detecting tuples t where <>terminator reference FunctionalData(source,target) | ||
57562 | */ | ||
57563 | private pattern mayInRelationterminator_reference_FunctionalData( | ||
57564 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
57565 | source: DefinedElement, target:DefinedElement) | ||
57566 | { | ||
57567 | find interpretation(problem,interpretation); | ||
57568 | // The two endpoint of the link have to exist | ||
57569 | find mayExist(problem, interpretation, source); | ||
57570 | find mayExist(problem, interpretation, target); | ||
57571 | // Type consistency | ||
57572 | find mayInstanceOfFunctionalData_class(problem,interpretation,source); | ||
57573 | find mayInstanceOfFAMTerminator_class(problem,interpretation,target); | ||
57574 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
57575 | // the upper bound of the multiplicity should be considered. | ||
57576 | numberOfExistingReferences == count find mustInRelationterminator_reference_FunctionalData(problem,interpretation,source,_); | ||
57577 | check(numberOfExistingReferences < 1); | ||
57578 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
57579 | // the upper bound of the opposite reference multiplicity should be considered. | ||
57580 | numberOfExistingOppositeReferences == count find mustInRelationdata_reference_FAMTerminator(problem,interpretation,target,_); | ||
57581 | check(numberOfExistingOppositeReferences < 1); | ||
57582 | // The reference is containment, then a new reference cannot be create if: | ||
57583 | // 1. Multiple parents | ||
57584 | neg find mustContains4(problem,interpretation,_,target); | ||
57585 | // 2. Circle in the containment hierarchy | ||
57586 | neg find mustTransitiveContains(source,target); | ||
57587 | } or { | ||
57588 | find mustInRelationterminator_reference_FunctionalData(problem,interpretation,source,target); | ||
57589 | } | ||
57590 | /** | ||
57591 | * Matcher for detecting tuples t where []interface reference FunctionalData(source,target) | ||
57592 | */ | ||
57593 | private pattern mustInRelationinterface_reference_FunctionalData( | ||
57594 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
57595 | source: DefinedElement, target:DefinedElement) | ||
57596 | { | ||
57597 | find interpretation(problem,interpretation); | ||
57598 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
57599 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"interface reference FunctionalData"); | ||
57600 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
57601 | BinaryElementRelationLink.param1(link,source); | ||
57602 | BinaryElementRelationLink.param2(link,target); | ||
57603 | } | ||
57604 | /** | ||
57605 | * Matcher for detecting tuples t where <>interface reference FunctionalData(source,target) | ||
57606 | */ | ||
57607 | private pattern mayInRelationinterface_reference_FunctionalData( | ||
57608 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
57609 | source: DefinedElement, target:DefinedElement) | ||
57610 | { | ||
57611 | find interpretation(problem,interpretation); | ||
57612 | // The two endpoint of the link have to exist | ||
57613 | find mayExist(problem, interpretation, source); | ||
57614 | find mayExist(problem, interpretation, target); | ||
57615 | // Type consistency | ||
57616 | find mayInstanceOfFunctionalData_class(problem,interpretation,source); | ||
57617 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,target); | ||
57618 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
57619 | // the upper bound of the multiplicity should be considered. | ||
57620 | numberOfExistingReferences == count find mustInRelationinterface_reference_FunctionalData(problem,interpretation,source,_); | ||
57621 | check(numberOfExistingReferences < 1); | ||
57622 | // The eOpposite of the reference is containment, then a referene cannot be created if | ||
57623 | // 1. Multiple parents | ||
57624 | neg find mustContains4(problem,interpretation,source,_); | ||
57625 | // 2. Circle in the containment hierarchy | ||
57626 | neg find mustTransitiveContains(source,target); | ||
57627 | } or { | ||
57628 | find mustInRelationinterface_reference_FunctionalData(problem,interpretation,source,target); | ||
57629 | } | ||
57630 | /** | ||
57631 | * Matcher for detecting tuples t where []type attribute Function(source,target) | ||
57632 | */ | ||
57633 | private pattern mustInRelationtype_attribute_Function( | ||
57634 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
57635 | source: DefinedElement, target:DefinedElement) | ||
57636 | { | ||
57637 | find interpretation(problem,interpretation); | ||
57638 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
57639 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"type attribute Function"); | ||
57640 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
57641 | BinaryElementRelationLink.param1(link,source); | ||
57642 | BinaryElementRelationLink.param2(link,target); | ||
57643 | } | ||
57644 | /** | ||
57645 | * Matcher for detecting tuples t where <>type attribute Function(source,target) | ||
57646 | */ | ||
57647 | private pattern mayInRelationtype_attribute_Function( | ||
57648 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
57649 | source: DefinedElement, target:DefinedElement) | ||
57650 | { | ||
57651 | find interpretation(problem,interpretation); | ||
57652 | // The two endpoint of the link have to exist | ||
57653 | find mayExist(problem, interpretation, source); | ||
57654 | find mayExist(problem, interpretation, target); | ||
57655 | // Type consistency | ||
57656 | find mayInstanceOfFunction_class(problem,interpretation,source); | ||
57657 | find mayInstanceOfFunctionType_enum(problem,interpretation,target); | ||
57658 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
57659 | // the upper bound of the multiplicity should be considered. | ||
57660 | numberOfExistingReferences == count find mustInRelationtype_attribute_Function(problem,interpretation,source,_); | ||
57661 | check(numberOfExistingReferences < 1); | ||
57662 | } or { | ||
57663 | find mustInRelationtype_attribute_Function(problem,interpretation,source,target); | ||
57664 | } | ||
57665 | |||
57666 | ////////// | ||
57667 | // 1.3 Relation Definition Indexers | ||
57668 | ////////// | ||
57669 | |||
57670 | ////////// | ||
57671 | // 1.4 Containment Indexer | ||
57672 | ////////// | ||
57673 | private pattern mustContains2(source: DefinedElement, target: DefinedElement) { | ||
57674 | find mustContains4(_,_,source,target); | ||
57675 | } | ||
57676 | |||
57677 | private pattern mustContains4(problem:LogicProblem, interpretation:PartialInterpretation, | ||
57678 | source: DefinedElement, target: DefinedElement) | ||
57679 | { find mustInRelationinterface_reference_FunctionalElement(problem,interpretation,source,target); }or | ||
57680 | |||
57681 | { find mustInRelationrootElements_reference_FunctionalArchitectureModel(problem,interpretation,source,target); }or | ||
57682 | |||
57683 | { find mustInRelationsubElements_reference_Function(problem,interpretation,source,target); }or | ||
57684 | |||
57685 | { find mustInRelationdata_reference_FunctionalInterface(problem,interpretation,source,target); }or | ||
57686 | |||
57687 | { find mustInRelationoutgoingLinks_reference_FunctionalOutput(problem,interpretation,source,target); }or | ||
57688 | |||
57689 | { find mustInRelationterminator_reference_FunctionalData(problem,interpretation,source,target); } | ||
57690 | |||
57691 | private pattern mustTransitiveContains(source,target) { | ||
57692 | find mustContains2+(source,target); | ||
57693 | } | ||
57694 | |||
57695 | ////////// | ||
57696 | // 2. Invalidation Indexers | ||
57697 | ////////// | ||
57698 | // 2.1 Invalidated by WF Queries | ||
57699 | ////////// | ||
57700 | |||
57701 | ////////// | ||
57702 | // 3. Unfinishedness Indexers | ||
57703 | ////////// | ||
57704 | // 3.1 Unfinishedness Measured by Multiplicity | ||
57705 | ////////// | ||
57706 | pattern unfinishedLowerMultiplicity_model_reference_FunctionalElement(problem:LogicProblem, interpretation:PartialInterpretation, relationIterpretation:PartialRelationInterpretation, object:DefinedElement,missingMultiplicity) { | ||
57707 | find interpretation(problem,interpretation); | ||
57708 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
57709 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"model reference FunctionalElement"); | ||
57710 | find mustInstanceOfFunctionalElement_class(problem,interpretation,object); | ||
57711 | numberOfExistingReferences == count find mustInRelationmodel_reference_FunctionalElement(problem,interpretation,object,_); | ||
57712 | check(numberOfExistingReferences < 1); | ||
57713 | missingMultiplicity == eval(1-numberOfExistingReferences); | ||
57714 | } | ||
57715 | pattern unfinishedLowerMultiplicity_to_reference_InformationLink(problem:LogicProblem, interpretation:PartialInterpretation, relationIterpretation:PartialRelationInterpretation, object:DefinedElement,missingMultiplicity) { | ||
57716 | find interpretation(problem,interpretation); | ||
57717 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
57718 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"to reference InformationLink"); | ||
57719 | find mustInstanceOfInformationLink_class(problem,interpretation,object); | ||
57720 | numberOfExistingReferences == count find mustInRelationto_reference_InformationLink(problem,interpretation,object,_); | ||
57721 | check(numberOfExistingReferences < 1); | ||
57722 | missingMultiplicity == eval(1-numberOfExistingReferences); | ||
57723 | } | ||
57724 | pattern unfinishedLowerMultiplicity_type_attribute_Function(problem:LogicProblem, interpretation:PartialInterpretation, relationIterpretation:PartialRelationInterpretation, object:DefinedElement,missingMultiplicity) { | ||
57725 | find interpretation(problem,interpretation); | ||
57726 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
57727 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"type attribute Function"); | ||
57728 | find mustInstanceOfFunction_class(problem,interpretation,object); | ||
57729 | numberOfExistingReferences == count find mustInRelationtype_attribute_Function(problem,interpretation,object,_); | ||
57730 | check(numberOfExistingReferences < 1); | ||
57731 | missingMultiplicity == eval(1-numberOfExistingReferences); | ||
57732 | } | ||
57733 | |||
57734 | ////////// | ||
57735 | // 3.2 Unfinishedness Measured by WF Queries | ||
57736 | ////////// | ||
57737 | |||
57738 | ////////// | ||
57739 | // 4. Refinement Indexers | ||
57740 | ////////// | ||
57741 | // 4.1 Object constructors | ||
57742 | ////////// | ||
57743 | private pattern hasElementInContainment(problem:LogicProblem, interpretation:PartialInterpretation) | ||
57744 | { | ||
57745 | find interpretation(problem,interpretation); | ||
57746 | find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,root); | ||
57747 | find mustExist(problem, interpretation, root); | ||
57748 | }or{ | ||
57749 | find interpretation(problem,interpretation); | ||
57750 | find mustInstanceOfFunctionalInput_class(problem,interpretation,root); | ||
57751 | find mustExist(problem, interpretation, root); | ||
57752 | }or{ | ||
57753 | find interpretation(problem,interpretation); | ||
57754 | find mustInstanceOfInformationLink_class(problem,interpretation,root); | ||
57755 | find mustExist(problem, interpretation, root); | ||
57756 | }or{ | ||
57757 | find interpretation(problem,interpretation); | ||
57758 | find mustInstanceOfFAMTerminator_class(problem,interpretation,root); | ||
57759 | find mustExist(problem, interpretation, root); | ||
57760 | }or{ | ||
57761 | find interpretation(problem,interpretation); | ||
57762 | find mustInstanceOfFunctionalElement_class(problem,interpretation,root); | ||
57763 | find mustExist(problem, interpretation, root); | ||
57764 | }or{ | ||
57765 | find interpretation(problem,interpretation); | ||
57766 | find mustInstanceOfFunction_class(problem,interpretation,root); | ||
57767 | find mustExist(problem, interpretation, root); | ||
57768 | }or{ | ||
57769 | find interpretation(problem,interpretation); | ||
57770 | find mustInstanceOfFunctionalOutput_class(problem,interpretation,root); | ||
57771 | find mustExist(problem, interpretation, root); | ||
57772 | }or{ | ||
57773 | find interpretation(problem,interpretation); | ||
57774 | find mustInstanceOfFunctionalInterface_class(problem,interpretation,root); | ||
57775 | find mustExist(problem, interpretation, root); | ||
57776 | }or{ | ||
57777 | find interpretation(problem,interpretation); | ||
57778 | find mustInstanceOfFunctionalData_class(problem,interpretation,root); | ||
57779 | find mustExist(problem, interpretation, root); | ||
57780 | } | ||
57781 | pattern createObject_FunctionalInterface_class_by_interface_reference_FunctionalElement_with_element_reference_FunctionalInterface( | ||
57782 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
57783 | relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
57784 | container:DefinedElement) | ||
57785 | { | ||
57786 | find interpretation(problem,interpretation); | ||
57787 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
57788 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalInterface class"); | ||
57789 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
57790 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"interface reference FunctionalElement"); | ||
57791 | PartialInterpretation.partialrelationinterpretation(interpretation,inverseInterpretation); | ||
57792 | PartialRelationInterpretation.interpretationOf.name(inverseInterpretation,"element reference FunctionalInterface"); | ||
57793 | find mustInstanceOfFunctionalElement_class(problem,interpretation,container); | ||
57794 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,newObject); | ||
57795 | find mayInRelationinterface_reference_FunctionalElement(problem,interpretation,container,newObject); | ||
57796 | find mustExist(problem, interpretation, container); | ||
57797 | neg find mustExist(problem, interpretation, newObject); | ||
57798 | } | ||
57799 | pattern createObject_FunctionalInterface_class( | ||
57800 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
57801 | typeInterpretation:PartialComplexTypeInterpretation) | ||
57802 | { | ||
57803 | find interpretation(problem,interpretation); | ||
57804 | neg find hasElementInContainment(problem,interpretation); | ||
57805 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
57806 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalInterface class"); | ||
57807 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,newObject); | ||
57808 | find mayExist(problem, interpretation, newObject); | ||
57809 | neg find mustExist(problem, interpretation, newObject); | ||
57810 | } | ||
57811 | pattern createObject_InformationLink_class_by_outgoingLinks_reference_FunctionalOutput_with_from_reference_InformationLink( | ||
57812 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
57813 | relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
57814 | container:DefinedElement) | ||
57815 | { | ||
57816 | find interpretation(problem,interpretation); | ||
57817 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
57818 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"InformationLink class"); | ||
57819 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
57820 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"outgoingLinks reference FunctionalOutput"); | ||
57821 | PartialInterpretation.partialrelationinterpretation(interpretation,inverseInterpretation); | ||
57822 | PartialRelationInterpretation.interpretationOf.name(inverseInterpretation,"from reference InformationLink"); | ||
57823 | find mustInstanceOfFunctionalOutput_class(problem,interpretation,container); | ||
57824 | find mayInstanceOfInformationLink_class(problem,interpretation,newObject); | ||
57825 | find mayInRelationoutgoingLinks_reference_FunctionalOutput(problem,interpretation,container,newObject); | ||
57826 | find mustExist(problem, interpretation, container); | ||
57827 | neg find mustExist(problem, interpretation, newObject); | ||
57828 | } | ||
57829 | pattern createObject_InformationLink_class( | ||
57830 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
57831 | typeInterpretation:PartialComplexTypeInterpretation) | ||
57832 | { | ||
57833 | find interpretation(problem,interpretation); | ||
57834 | neg find hasElementInContainment(problem,interpretation); | ||
57835 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
57836 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"InformationLink class"); | ||
57837 | find mayInstanceOfInformationLink_class(problem,interpretation,newObject); | ||
57838 | find mayExist(problem, interpretation, newObject); | ||
57839 | neg find mustExist(problem, interpretation, newObject); | ||
57840 | } | ||
57841 | pattern createObject_FunctionalOutput_class_by_data_reference_FunctionalInterface_with_interface_reference_FunctionalData( | ||
57842 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
57843 | relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
57844 | container:DefinedElement) | ||
57845 | { | ||
57846 | find interpretation(problem,interpretation); | ||
57847 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
57848 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalOutput class"); | ||
57849 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
57850 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"data reference FunctionalInterface"); | ||
57851 | PartialInterpretation.partialrelationinterpretation(interpretation,inverseInterpretation); | ||
57852 | PartialRelationInterpretation.interpretationOf.name(inverseInterpretation,"interface reference FunctionalData"); | ||
57853 | find mustInstanceOfFunctionalInterface_class(problem,interpretation,container); | ||
57854 | find mayInstanceOfFunctionalOutput_class(problem,interpretation,newObject); | ||
57855 | find mayInRelationdata_reference_FunctionalInterface(problem,interpretation,container,newObject); | ||
57856 | find mustExist(problem, interpretation, container); | ||
57857 | neg find mustExist(problem, interpretation, newObject); | ||
57858 | } | ||
57859 | pattern createObject_FunctionalOutput_class( | ||
57860 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
57861 | typeInterpretation:PartialComplexTypeInterpretation) | ||
57862 | { | ||
57863 | find interpretation(problem,interpretation); | ||
57864 | neg find hasElementInContainment(problem,interpretation); | ||
57865 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
57866 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalOutput class"); | ||
57867 | find mayInstanceOfFunctionalOutput_class(problem,interpretation,newObject); | ||
57868 | find mayExist(problem, interpretation, newObject); | ||
57869 | neg find mustExist(problem, interpretation, newObject); | ||
57870 | } | ||
57871 | pattern createObject_FAMTerminator_class_by_terminator_reference_FunctionalData_with_data_reference_FAMTerminator( | ||
57872 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
57873 | relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
57874 | container:DefinedElement) | ||
57875 | { | ||
57876 | find interpretation(problem,interpretation); | ||
57877 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
57878 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FAMTerminator class"); | ||
57879 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
57880 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"terminator reference FunctionalData"); | ||
57881 | PartialInterpretation.partialrelationinterpretation(interpretation,inverseInterpretation); | ||
57882 | PartialRelationInterpretation.interpretationOf.name(inverseInterpretation,"data reference FAMTerminator"); | ||
57883 | find mustInstanceOfFunctionalData_class(problem,interpretation,container); | ||
57884 | find mayInstanceOfFAMTerminator_class(problem,interpretation,newObject); | ||
57885 | find mayInRelationterminator_reference_FunctionalData(problem,interpretation,container,newObject); | ||
57886 | find mustExist(problem, interpretation, container); | ||
57887 | neg find mustExist(problem, interpretation, newObject); | ||
57888 | } | ||
57889 | pattern createObject_FAMTerminator_class( | ||
57890 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
57891 | typeInterpretation:PartialComplexTypeInterpretation) | ||
57892 | { | ||
57893 | find interpretation(problem,interpretation); | ||
57894 | neg find hasElementInContainment(problem,interpretation); | ||
57895 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
57896 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FAMTerminator class"); | ||
57897 | find mayInstanceOfFAMTerminator_class(problem,interpretation,newObject); | ||
57898 | find mayExist(problem, interpretation, newObject); | ||
57899 | neg find mustExist(problem, interpretation, newObject); | ||
57900 | } | ||
57901 | pattern createObject_FunctionalInput_class_by_data_reference_FunctionalInterface_with_interface_reference_FunctionalData( | ||
57902 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
57903 | relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
57904 | container:DefinedElement) | ||
57905 | { | ||
57906 | find interpretation(problem,interpretation); | ||
57907 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
57908 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalInput class"); | ||
57909 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
57910 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"data reference FunctionalInterface"); | ||
57911 | PartialInterpretation.partialrelationinterpretation(interpretation,inverseInterpretation); | ||
57912 | PartialRelationInterpretation.interpretationOf.name(inverseInterpretation,"interface reference FunctionalData"); | ||
57913 | find mustInstanceOfFunctionalInterface_class(problem,interpretation,container); | ||
57914 | find mayInstanceOfFunctionalInput_class(problem,interpretation,newObject); | ||
57915 | find mayInRelationdata_reference_FunctionalInterface(problem,interpretation,container,newObject); | ||
57916 | find mustExist(problem, interpretation, container); | ||
57917 | neg find mustExist(problem, interpretation, newObject); | ||
57918 | } | ||
57919 | pattern createObject_FunctionalInput_class( | ||
57920 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
57921 | typeInterpretation:PartialComplexTypeInterpretation) | ||
57922 | { | ||
57923 | find interpretation(problem,interpretation); | ||
57924 | neg find hasElementInContainment(problem,interpretation); | ||
57925 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
57926 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalInput class"); | ||
57927 | find mayInstanceOfFunctionalInput_class(problem,interpretation,newObject); | ||
57928 | find mayExist(problem, interpretation, newObject); | ||
57929 | neg find mustExist(problem, interpretation, newObject); | ||
57930 | } | ||
57931 | pattern createObject_Function_class_by_rootElements_reference_FunctionalArchitectureModel( | ||
57932 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
57933 | relationInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
57934 | container:DefinedElement) | ||
57935 | { | ||
57936 | find interpretation(problem,interpretation); | ||
57937 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
57938 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"Function class"); | ||
57939 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
57940 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"rootElements reference FunctionalArchitectureModel"); | ||
57941 | find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,container); | ||
57942 | find mayInstanceOfFunction_class(problem,interpretation,newObject); | ||
57943 | find mayInRelationrootElements_reference_FunctionalArchitectureModel(problem,interpretation,container,newObject); | ||
57944 | find mustExist(problem, interpretation, container); | ||
57945 | neg find mustExist(problem, interpretation, newObject); | ||
57946 | } | ||
57947 | pattern createObject_Function_class_by_subElements_reference_Function_with_parent_reference_FunctionalElement( | ||
57948 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
57949 | relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
57950 | container:DefinedElement) | ||
57951 | { | ||
57952 | find interpretation(problem,interpretation); | ||
57953 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
57954 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"Function class"); | ||
57955 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
57956 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"subElements reference Function"); | ||
57957 | PartialInterpretation.partialrelationinterpretation(interpretation,inverseInterpretation); | ||
57958 | PartialRelationInterpretation.interpretationOf.name(inverseInterpretation,"parent reference FunctionalElement"); | ||
57959 | find mustInstanceOfFunction_class(problem,interpretation,container); | ||
57960 | find mayInstanceOfFunction_class(problem,interpretation,newObject); | ||
57961 | find mayInRelationsubElements_reference_Function(problem,interpretation,container,newObject); | ||
57962 | find mustExist(problem, interpretation, container); | ||
57963 | neg find mustExist(problem, interpretation, newObject); | ||
57964 | } | ||
57965 | pattern createObject_Function_class( | ||
57966 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
57967 | typeInterpretation:PartialComplexTypeInterpretation) | ||
57968 | { | ||
57969 | find interpretation(problem,interpretation); | ||
57970 | neg find hasElementInContainment(problem,interpretation); | ||
57971 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
57972 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"Function class"); | ||
57973 | find mayInstanceOfFunction_class(problem,interpretation,newObject); | ||
57974 | find mayExist(problem, interpretation, newObject); | ||
57975 | neg find mustExist(problem, interpretation, newObject); | ||
57976 | } | ||
57977 | pattern createObject_FunctionalArchitectureModel_class( | ||
57978 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
57979 | typeInterpretation:PartialComplexTypeInterpretation) | ||
57980 | { | ||
57981 | find interpretation(problem,interpretation); | ||
57982 | neg find hasElementInContainment(problem,interpretation); | ||
57983 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
57984 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalArchitectureModel class"); | ||
57985 | find mayInstanceOfFunctionalArchitectureModel_class(problem,interpretation,newObject); | ||
57986 | find mayExist(problem, interpretation, newObject); | ||
57987 | neg find mustExist(problem, interpretation, newObject); | ||
57988 | } | ||
57989 | |||
57990 | ////////// | ||
57991 | // 4.2 Type refinement | ||
57992 | ////////// | ||
57993 | pattern refineTypeTo_FunctionalInterface_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
57994 | find interpretation(problem,interpretation); | ||
57995 | PartialInterpretation.newElements(interpretation,element); | ||
57996 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
57997 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
57998 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
57999 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
58000 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
58001 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
58002 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
58003 | } | ||
58004 | pattern refineTypeTo_InformationLink_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
58005 | find interpretation(problem,interpretation); | ||
58006 | PartialInterpretation.newElements(interpretation,element); | ||
58007 | find mayInstanceOfInformationLink_class(problem,interpretation,element); | ||
58008 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
58009 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
58010 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
58011 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
58012 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
58013 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
58014 | } | ||
58015 | pattern refineTypeTo_FunctionalOutput_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
58016 | find interpretation(problem,interpretation); | ||
58017 | PartialInterpretation.newElements(interpretation,element); | ||
58018 | find mayInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
58019 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
58020 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
58021 | neg find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
58022 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
58023 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
58024 | neg find mustInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
58025 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
58026 | } | ||
58027 | pattern refineTypeTo_FAMTerminator_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
58028 | find interpretation(problem,interpretation); | ||
58029 | PartialInterpretation.newElements(interpretation,element); | ||
58030 | find mayInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
58031 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
58032 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
58033 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
58034 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
58035 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
58036 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
58037 | } | ||
58038 | pattern refineTypeTo_FunctionalInput_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
58039 | find interpretation(problem,interpretation); | ||
58040 | PartialInterpretation.newElements(interpretation,element); | ||
58041 | find mayInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
58042 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
58043 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
58044 | neg find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
58045 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
58046 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
58047 | neg find mustInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
58048 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
58049 | } | ||
58050 | pattern refineTypeTo_Function_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
58051 | find interpretation(problem,interpretation); | ||
58052 | PartialInterpretation.newElements(interpretation,element); | ||
58053 | find mayInstanceOfFunction_class(problem,interpretation,element); | ||
58054 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
58055 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
58056 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
58057 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
58058 | neg find mustInstanceOfFunction_class(problem,interpretation,element); | ||
58059 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
58060 | } | ||
58061 | pattern refineTypeTo_FunctionalArchitectureModel_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
58062 | find interpretation(problem,interpretation); | ||
58063 | PartialInterpretation.newElements(interpretation,element); | ||
58064 | find mayInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
58065 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
58066 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
58067 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
58068 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
58069 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
58070 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
58071 | } | ||
58072 | |||
58073 | ////////// | ||
58074 | // 4.3 Relation refinement | ||
58075 | ////////// | ||
58076 | pattern refineRelation_model_reference_FunctionalElement( | ||
58077 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
58078 | relationIterpretation:PartialRelationInterpretation, | ||
58079 | from: DefinedElement, to: DefinedElement) | ||
58080 | { | ||
58081 | find interpretation(problem,interpretation); | ||
58082 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
58083 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"model reference FunctionalElement"); | ||
58084 | find mustExist(problem, interpretation, from); | ||
58085 | find mustExist(problem, interpretation, to); | ||
58086 | find mustInstanceOfFunctionalElement_class(problem,interpretation,from); | ||
58087 | find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,to); | ||
58088 | find mayInRelationmodel_reference_FunctionalElement(problem,interpretation,from,to); | ||
58089 | neg find mustInRelationmodel_reference_FunctionalElement(problem,interpretation,from,to); | ||
58090 | } | ||
58091 | pattern refineRelation_IncomingLinks_reference_FunctionalInput_and_to_reference_InformationLink( | ||
58092 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
58093 | relationIterpretation:PartialRelationInterpretation, oppositeInterpretation:PartialRelationInterpretation, | ||
58094 | from: DefinedElement, to: DefinedElement) | ||
58095 | { | ||
58096 | find interpretation(problem,interpretation); | ||
58097 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
58098 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"IncomingLinks reference FunctionalInput"); | ||
58099 | PartialInterpretation.partialrelationinterpretation(interpretation,oppositeInterpretation); | ||
58100 | PartialRelationInterpretation.interpretationOf.name(oppositeInterpretation,"to reference InformationLink"); | ||
58101 | find mustExist(problem, interpretation, from); | ||
58102 | find mustExist(problem, interpretation, to); | ||
58103 | find mustInstanceOfFunctionalInput_class(problem,interpretation,from); | ||
58104 | find mustInstanceOfInformationLink_class(problem,interpretation,to); | ||
58105 | find mayInRelationIncomingLinks_reference_FunctionalInput(problem,interpretation,from,to); | ||
58106 | neg find mustInRelationIncomingLinks_reference_FunctionalInput(problem,interpretation,from,to); | ||
58107 | } | ||
58108 | pattern refineRelation_type_attribute_Function( | ||
58109 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
58110 | relationIterpretation:PartialRelationInterpretation, | ||
58111 | from: DefinedElement, to: DefinedElement) | ||
58112 | { | ||
58113 | find interpretation(problem,interpretation); | ||
58114 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
58115 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"type attribute Function"); | ||
58116 | find mustExist(problem, interpretation, from); | ||
58117 | find mustExist(problem, interpretation, to); | ||
58118 | find mustInstanceOfFunction_class(problem,interpretation,from); | ||
58119 | find mustInstanceOfFunctionType_enum(problem,interpretation,to); | ||
58120 | find mayInRelationtype_attribute_Function(problem,interpretation,from,to); | ||
58121 | neg find mustInRelationtype_attribute_Function(problem,interpretation,from,to); | ||
58122 | } | ||
58123 | import epackage "http://www.bme.hu/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage" | ||
58124 | import epackage "http://www.bme.hu/mit/inf/dslreasoner/logic/model/problem" | ||
58125 | import epackage "http://www.bme.hu/mit/inf/dslreasoner/logic/model/language" | ||
58126 | |||
58127 | ////////// | ||
58128 | // 0. Util | ||
58129 | ////////// | ||
58130 | private pattern interpretation(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
58131 | PartialInterpretation.problem(interpretation,problem); | ||
58132 | } | ||
58133 | |||
58134 | ///////////////////////// | ||
58135 | // 0.1 Existence | ||
58136 | ///////////////////////// | ||
58137 | private pattern mustExist(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
58138 | find interpretation(problem,interpretation); | ||
58139 | LogicProblem.elements(problem,element); | ||
58140 | } or { | ||
58141 | find interpretation(problem,interpretation); | ||
58142 | PartialInterpretation.newElements(interpretation,element); | ||
58143 | } | ||
58144 | |||
58145 | private pattern mayExist(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
58146 | find mustExist(problem,interpretation,element); | ||
58147 | } or { | ||
58148 | find interpretation(problem,interpretation); | ||
58149 | neg find elementCloseWorld(element); | ||
58150 | PartialInterpretation.openWorldElements(interpretation,element); | ||
58151 | } | ||
58152 | |||
58153 | private pattern elementCloseWorld(element:DefinedElement) { | ||
58154 | PartialInterpretation.openWorldElements(i,element); | ||
58155 | PartialInterpretation.maxNewElements(i,0); | ||
58156 | } or { | ||
58157 | Scope.targetTypeInterpretation(scope,interpretation); | ||
58158 | PartialTypeInterpratation.elements(interpretation,element); | ||
58159 | Scope.maxNewElements(scope,0); | ||
58160 | } | ||
58161 | |||
58162 | //////////////////////// | ||
58163 | // 0.2 Equivalence | ||
58164 | //////////////////////// | ||
58165 | pattern mayEquivalent(problem:LogicProblem, interpretation:PartialInterpretation, a: DefinedElement, b: DefinedElement) { | ||
58166 | find mayExist(problem,interpretation,a); | ||
58167 | find mayExist(problem,interpretation,b); | ||
58168 | a == b; | ||
58169 | } | ||
58170 | |||
58171 | //////////////////////// | ||
58172 | // 0.3 Required Patterns by TypeIndexer | ||
58173 | //////////////////////// | ||
58174 | private pattern typeInterpretation(problem:LogicProblem, interpretation:PartialInterpretation, type:TypeDeclaration, typeInterpretation:PartialComplexTypeInterpretation) { | ||
58175 | find interpretation(problem,interpretation); | ||
58176 | LogicProblem.types(problem,type); | ||
58177 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
58178 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
58179 | } | ||
58180 | |||
58181 | private pattern directInstanceOf(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement, type:Type) { | ||
58182 | find interpretation(problem,interpretation); | ||
58183 | LogicProblem.types(problem,type); | ||
58184 | TypeDefinition.elements(type,element); | ||
58185 | } or { | ||
58186 | find interpretation(problem,interpretation); | ||
58187 | find typeInterpretation(problem,interpretation,type,typeInterpretation); | ||
58188 | PartialComplexTypeInterpretation.elements(typeInterpretation,element); | ||
58189 | } | ||
58190 | |||
58191 | private pattern isPrimitive(element: PrimitiveElement) { | ||
58192 | PrimitiveElement(element); | ||
58193 | } | ||
58194 | |||
58195 | ////////// | ||
58196 | // 1. Problem-Specific Base Indexers | ||
58197 | ////////// | ||
58198 | // 1.1 Type Indexers | ||
58199 | ////////// | ||
58200 | // 1.1.1 primitive Type Indexers | ||
58201 | ////////// | ||
58202 | |||
58203 | ////////// | ||
58204 | // 1.1.2 domain-specific Type Indexers | ||
58205 | ////////// | ||
58206 | /** | ||
58207 | * An element must be an instance of type "FunctionalElement class". | ||
58208 | */ | ||
58209 | private pattern mustInstanceOfFunctionalElement_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
58210 | Type.name(type,"FunctionalElement class"); | ||
58211 | find directInstanceOf(problem,interpretation,element,type); | ||
58212 | } | ||
58213 | private pattern scopeDisallowsNewFunctionalElement_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
58214 | find interpretation(problem,interpretation); | ||
58215 | PartialInterpretation.scopes(interpretation,scope); | ||
58216 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
58217 | Scope.maxNewElements(scope,0); | ||
58218 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
58219 | Type.name(type,"FunctionalElement class"); | ||
58220 | } | ||
58221 | |||
58222 | /** | ||
58223 | * An element may be an instance of type "FunctionalElement class". | ||
58224 | */ | ||
58225 | private pattern mayInstanceOfFunctionalElement_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
58226 | { | ||
58227 | find interpretation(problem,interpretation); | ||
58228 | PartialInterpretation.newElements(interpretation,element); | ||
58229 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
58230 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
58231 | neg find mustInstanceOfFunction_class(problem,interpretation,element); | ||
58232 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
58233 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
58234 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
58235 | neg find scopeDisallowsNewFunctionalElement_class(problem, interpretation); | ||
58236 | neg find isPrimitive(element); | ||
58237 | } or { | ||
58238 | find interpretation(problem,interpretation); | ||
58239 | PartialInterpretation.openWorldElements(interpretation,element); | ||
58240 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
58241 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
58242 | neg find mustInstanceOfFunction_class(problem,interpretation,element); | ||
58243 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
58244 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
58245 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
58246 | neg find scopeDisallowsNewFunctionalElement_class(problem, interpretation); | ||
58247 | neg find isPrimitive(element); | ||
58248 | } or | ||
58249 | { find mustInstanceOfFunctionalElement_class(problem,interpretation,element); } | ||
58250 | /** | ||
58251 | * An element must be an instance of type "FunctionalArchitectureModel class". | ||
58252 | */ | ||
58253 | private pattern mustInstanceOfFunctionalArchitectureModel_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
58254 | Type.name(type,"FunctionalArchitectureModel class"); | ||
58255 | find directInstanceOf(problem,interpretation,element,type); | ||
58256 | } | ||
58257 | private pattern scopeDisallowsNewFunctionalArchitectureModel_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
58258 | find interpretation(problem,interpretation); | ||
58259 | PartialInterpretation.scopes(interpretation,scope); | ||
58260 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
58261 | Scope.maxNewElements(scope,0); | ||
58262 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
58263 | Type.name(type,"FunctionalArchitectureModel class"); | ||
58264 | } | ||
58265 | |||
58266 | /** | ||
58267 | * An element may be an instance of type "FunctionalArchitectureModel class". | ||
58268 | */ | ||
58269 | private pattern mayInstanceOfFunctionalArchitectureModel_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
58270 | { | ||
58271 | find interpretation(problem,interpretation); | ||
58272 | PartialInterpretation.newElements(interpretation,element); | ||
58273 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
58274 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
58275 | neg find mustInstanceOfFunctionalArchitectureModel_class_UndefinedPart(problem,interpretation,element); | ||
58276 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
58277 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
58278 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
58279 | neg find scopeDisallowsNewFunctionalArchitectureModel_class(problem, interpretation); | ||
58280 | neg find isPrimitive(element); | ||
58281 | } or { | ||
58282 | find interpretation(problem,interpretation); | ||
58283 | PartialInterpretation.openWorldElements(interpretation,element); | ||
58284 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
58285 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
58286 | neg find mustInstanceOfFunctionalArchitectureModel_class_UndefinedPart(problem,interpretation,element); | ||
58287 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
58288 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
58289 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
58290 | neg find scopeDisallowsNewFunctionalArchitectureModel_class(problem, interpretation); | ||
58291 | neg find isPrimitive(element); | ||
58292 | } or | ||
58293 | { find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); } | ||
58294 | /** | ||
58295 | * An element must be an instance of type "Function class". | ||
58296 | */ | ||
58297 | private pattern mustInstanceOfFunction_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
58298 | Type.name(type,"Function class"); | ||
58299 | find directInstanceOf(problem,interpretation,element,type); | ||
58300 | } | ||
58301 | private pattern scopeDisallowsNewFunction_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
58302 | find interpretation(problem,interpretation); | ||
58303 | PartialInterpretation.scopes(interpretation,scope); | ||
58304 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
58305 | Scope.maxNewElements(scope,0); | ||
58306 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
58307 | Type.name(type,"Function class"); | ||
58308 | } | ||
58309 | |||
58310 | /** | ||
58311 | * An element may be an instance of type "Function class". | ||
58312 | */ | ||
58313 | private pattern mayInstanceOfFunction_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
58314 | { | ||
58315 | find interpretation(problem,interpretation); | ||
58316 | PartialInterpretation.newElements(interpretation,element); | ||
58317 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
58318 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
58319 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
58320 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
58321 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
58322 | neg find scopeDisallowsNewFunction_class(problem, interpretation); | ||
58323 | neg find isPrimitive(element); | ||
58324 | } or { | ||
58325 | find interpretation(problem,interpretation); | ||
58326 | PartialInterpretation.openWorldElements(interpretation,element); | ||
58327 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
58328 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
58329 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
58330 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
58331 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
58332 | neg find scopeDisallowsNewFunction_class(problem, interpretation); | ||
58333 | neg find isPrimitive(element); | ||
58334 | } or | ||
58335 | { find mustInstanceOfFunction_class(problem,interpretation,element); } | ||
58336 | /** | ||
58337 | * An element must be an instance of type "FAMTerminator class". | ||
58338 | */ | ||
58339 | private pattern mustInstanceOfFAMTerminator_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
58340 | Type.name(type,"FAMTerminator class"); | ||
58341 | find directInstanceOf(problem,interpretation,element,type); | ||
58342 | } | ||
58343 | private pattern scopeDisallowsNewFAMTerminator_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
58344 | find interpretation(problem,interpretation); | ||
58345 | PartialInterpretation.scopes(interpretation,scope); | ||
58346 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
58347 | Scope.maxNewElements(scope,0); | ||
58348 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
58349 | Type.name(type,"FAMTerminator class"); | ||
58350 | } | ||
58351 | |||
58352 | /** | ||
58353 | * An element may be an instance of type "FAMTerminator class". | ||
58354 | */ | ||
58355 | private pattern mayInstanceOfFAMTerminator_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
58356 | { | ||
58357 | find interpretation(problem,interpretation); | ||
58358 | PartialInterpretation.newElements(interpretation,element); | ||
58359 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
58360 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
58361 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
58362 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
58363 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
58364 | neg find scopeDisallowsNewFAMTerminator_class(problem, interpretation); | ||
58365 | neg find isPrimitive(element); | ||
58366 | } or { | ||
58367 | find interpretation(problem,interpretation); | ||
58368 | PartialInterpretation.openWorldElements(interpretation,element); | ||
58369 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
58370 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
58371 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
58372 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
58373 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
58374 | neg find scopeDisallowsNewFAMTerminator_class(problem, interpretation); | ||
58375 | neg find isPrimitive(element); | ||
58376 | } or | ||
58377 | { find mustInstanceOfFAMTerminator_class(problem,interpretation,element); } | ||
58378 | /** | ||
58379 | * An element must be an instance of type "InformationLink class". | ||
58380 | */ | ||
58381 | private pattern mustInstanceOfInformationLink_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
58382 | Type.name(type,"InformationLink class"); | ||
58383 | find directInstanceOf(problem,interpretation,element,type); | ||
58384 | } | ||
58385 | private pattern scopeDisallowsNewInformationLink_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
58386 | find interpretation(problem,interpretation); | ||
58387 | PartialInterpretation.scopes(interpretation,scope); | ||
58388 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
58389 | Scope.maxNewElements(scope,0); | ||
58390 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
58391 | Type.name(type,"InformationLink class"); | ||
58392 | } | ||
58393 | |||
58394 | /** | ||
58395 | * An element may be an instance of type "InformationLink class". | ||
58396 | */ | ||
58397 | private pattern mayInstanceOfInformationLink_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
58398 | { | ||
58399 | find interpretation(problem,interpretation); | ||
58400 | PartialInterpretation.newElements(interpretation,element); | ||
58401 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
58402 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
58403 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
58404 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
58405 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
58406 | neg find scopeDisallowsNewInformationLink_class(problem, interpretation); | ||
58407 | neg find isPrimitive(element); | ||
58408 | } or { | ||
58409 | find interpretation(problem,interpretation); | ||
58410 | PartialInterpretation.openWorldElements(interpretation,element); | ||
58411 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
58412 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
58413 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
58414 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
58415 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
58416 | neg find scopeDisallowsNewInformationLink_class(problem, interpretation); | ||
58417 | neg find isPrimitive(element); | ||
58418 | } or | ||
58419 | { find mustInstanceOfInformationLink_class(problem,interpretation,element); } | ||
58420 | /** | ||
58421 | * An element must be an instance of type "FunctionalInterface class". | ||
58422 | */ | ||
58423 | private pattern mustInstanceOfFunctionalInterface_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
58424 | Type.name(type,"FunctionalInterface class"); | ||
58425 | find directInstanceOf(problem,interpretation,element,type); | ||
58426 | } | ||
58427 | private pattern scopeDisallowsNewFunctionalInterface_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
58428 | find interpretation(problem,interpretation); | ||
58429 | PartialInterpretation.scopes(interpretation,scope); | ||
58430 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
58431 | Scope.maxNewElements(scope,0); | ||
58432 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
58433 | Type.name(type,"FunctionalInterface class"); | ||
58434 | } | ||
58435 | |||
58436 | /** | ||
58437 | * An element may be an instance of type "FunctionalInterface class". | ||
58438 | */ | ||
58439 | private pattern mayInstanceOfFunctionalInterface_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
58440 | { | ||
58441 | find interpretation(problem,interpretation); | ||
58442 | PartialInterpretation.newElements(interpretation,element); | ||
58443 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
58444 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
58445 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
58446 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
58447 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
58448 | neg find scopeDisallowsNewFunctionalInterface_class(problem, interpretation); | ||
58449 | neg find isPrimitive(element); | ||
58450 | } or { | ||
58451 | find interpretation(problem,interpretation); | ||
58452 | PartialInterpretation.openWorldElements(interpretation,element); | ||
58453 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
58454 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
58455 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
58456 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
58457 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
58458 | neg find scopeDisallowsNewFunctionalInterface_class(problem, interpretation); | ||
58459 | neg find isPrimitive(element); | ||
58460 | } or | ||
58461 | { find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); } | ||
58462 | /** | ||
58463 | * An element must be an instance of type "FunctionalInput class". | ||
58464 | */ | ||
58465 | private pattern mustInstanceOfFunctionalInput_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
58466 | Type.name(type,"FunctionalInput class"); | ||
58467 | find directInstanceOf(problem,interpretation,element,type); | ||
58468 | } | ||
58469 | private pattern scopeDisallowsNewFunctionalInput_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
58470 | find interpretation(problem,interpretation); | ||
58471 | PartialInterpretation.scopes(interpretation,scope); | ||
58472 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
58473 | Scope.maxNewElements(scope,0); | ||
58474 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
58475 | Type.name(type,"FunctionalInput class"); | ||
58476 | } | ||
58477 | |||
58478 | /** | ||
58479 | * An element may be an instance of type "FunctionalInput class". | ||
58480 | */ | ||
58481 | private pattern mayInstanceOfFunctionalInput_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
58482 | { | ||
58483 | find interpretation(problem,interpretation); | ||
58484 | PartialInterpretation.newElements(interpretation,element); | ||
58485 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
58486 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
58487 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
58488 | neg find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
58489 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
58490 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
58491 | neg find scopeDisallowsNewFunctionalInput_class(problem, interpretation); | ||
58492 | neg find isPrimitive(element); | ||
58493 | } or { | ||
58494 | find interpretation(problem,interpretation); | ||
58495 | PartialInterpretation.openWorldElements(interpretation,element); | ||
58496 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
58497 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
58498 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
58499 | neg find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
58500 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
58501 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
58502 | neg find scopeDisallowsNewFunctionalInput_class(problem, interpretation); | ||
58503 | neg find isPrimitive(element); | ||
58504 | } or | ||
58505 | { find mustInstanceOfFunctionalInput_class(problem,interpretation,element); } | ||
58506 | /** | ||
58507 | * An element must be an instance of type "FunctionalOutput class". | ||
58508 | */ | ||
58509 | private pattern mustInstanceOfFunctionalOutput_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
58510 | Type.name(type,"FunctionalOutput class"); | ||
58511 | find directInstanceOf(problem,interpretation,element,type); | ||
58512 | } | ||
58513 | private pattern scopeDisallowsNewFunctionalOutput_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
58514 | find interpretation(problem,interpretation); | ||
58515 | PartialInterpretation.scopes(interpretation,scope); | ||
58516 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
58517 | Scope.maxNewElements(scope,0); | ||
58518 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
58519 | Type.name(type,"FunctionalOutput class"); | ||
58520 | } | ||
58521 | |||
58522 | /** | ||
58523 | * An element may be an instance of type "FunctionalOutput class". | ||
58524 | */ | ||
58525 | private pattern mayInstanceOfFunctionalOutput_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
58526 | { | ||
58527 | find interpretation(problem,interpretation); | ||
58528 | PartialInterpretation.newElements(interpretation,element); | ||
58529 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
58530 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
58531 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
58532 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
58533 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
58534 | neg find mustInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
58535 | neg find scopeDisallowsNewFunctionalOutput_class(problem, interpretation); | ||
58536 | neg find isPrimitive(element); | ||
58537 | } or { | ||
58538 | find interpretation(problem,interpretation); | ||
58539 | PartialInterpretation.openWorldElements(interpretation,element); | ||
58540 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
58541 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
58542 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
58543 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
58544 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
58545 | neg find mustInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
58546 | neg find scopeDisallowsNewFunctionalOutput_class(problem, interpretation); | ||
58547 | neg find isPrimitive(element); | ||
58548 | } or | ||
58549 | { find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); } | ||
58550 | /** | ||
58551 | * An element must be an instance of type "FunctionalData class". | ||
58552 | */ | ||
58553 | private pattern mustInstanceOfFunctionalData_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
58554 | Type.name(type,"FunctionalData class"); | ||
58555 | find directInstanceOf(problem,interpretation,element,type); | ||
58556 | } | ||
58557 | private pattern scopeDisallowsNewFunctionalData_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
58558 | find interpretation(problem,interpretation); | ||
58559 | PartialInterpretation.scopes(interpretation,scope); | ||
58560 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
58561 | Scope.maxNewElements(scope,0); | ||
58562 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
58563 | Type.name(type,"FunctionalData class"); | ||
58564 | } | ||
58565 | |||
58566 | /** | ||
58567 | * An element may be an instance of type "FunctionalData class". | ||
58568 | */ | ||
58569 | private pattern mayInstanceOfFunctionalData_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
58570 | { | ||
58571 | find interpretation(problem,interpretation); | ||
58572 | PartialInterpretation.newElements(interpretation,element); | ||
58573 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
58574 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
58575 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
58576 | neg find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
58577 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
58578 | neg find mustInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
58579 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
58580 | neg find scopeDisallowsNewFunctionalData_class(problem, interpretation); | ||
58581 | neg find isPrimitive(element); | ||
58582 | } or { | ||
58583 | find interpretation(problem,interpretation); | ||
58584 | PartialInterpretation.openWorldElements(interpretation,element); | ||
58585 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
58586 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
58587 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
58588 | neg find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
58589 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
58590 | neg find mustInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
58591 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
58592 | neg find scopeDisallowsNewFunctionalData_class(problem, interpretation); | ||
58593 | neg find isPrimitive(element); | ||
58594 | } or | ||
58595 | { find mustInstanceOfFunctionalData_class(problem,interpretation,element); } | ||
58596 | /** | ||
58597 | * An element must be an instance of type "FunctionType enum". | ||
58598 | */ | ||
58599 | private pattern mustInstanceOfFunctionType_enum(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
58600 | Type.name(type,"FunctionType enum"); | ||
58601 | find directInstanceOf(problem,interpretation,element,type); | ||
58602 | } | ||
58603 | private pattern scopeDisallowsNewFunctionType_enum(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
58604 | find interpretation(problem,interpretation); | ||
58605 | PartialInterpretation.scopes(interpretation,scope); | ||
58606 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
58607 | Scope.maxNewElements(scope,0); | ||
58608 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
58609 | Type.name(type,"FunctionType enum"); | ||
58610 | } | ||
58611 | |||
58612 | /** | ||
58613 | * An element may be an instance of type "FunctionType enum". | ||
58614 | */ | ||
58615 | private pattern mayInstanceOfFunctionType_enum(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
58616 | { find mustInstanceOfFunctionType_enum(problem,interpretation,element); } | ||
58617 | /** | ||
58618 | * An element must be an instance of type "FunctionalArchitectureModel class DefinedPart". | ||
58619 | */ | ||
58620 | private pattern mustInstanceOfFunctionalArchitectureModel_class_DefinedPart(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
58621 | Type.name(type,"FunctionalArchitectureModel class DefinedPart"); | ||
58622 | find directInstanceOf(problem,interpretation,element,type); | ||
58623 | } | ||
58624 | private pattern scopeDisallowsNewFunctionalArchitectureModel_class_DefinedPart(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
58625 | find interpretation(problem,interpretation); | ||
58626 | PartialInterpretation.scopes(interpretation,scope); | ||
58627 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
58628 | Scope.maxNewElements(scope,0); | ||
58629 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
58630 | Type.name(type,"FunctionalArchitectureModel class DefinedPart"); | ||
58631 | } | ||
58632 | |||
58633 | /** | ||
58634 | * An element may be an instance of type "FunctionalArchitectureModel class DefinedPart". | ||
58635 | */ | ||
58636 | private pattern mayInstanceOfFunctionalArchitectureModel_class_DefinedPart(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
58637 | { find mustInstanceOfFunctionalArchitectureModel_class_DefinedPart(problem,interpretation,element); } | ||
58638 | /** | ||
58639 | * An element must be an instance of type "FunctionalArchitectureModel class UndefinedPart". | ||
58640 | */ | ||
58641 | private pattern mustInstanceOfFunctionalArchitectureModel_class_UndefinedPart(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
58642 | Type.name(type,"FunctionalArchitectureModel class UndefinedPart"); | ||
58643 | find directInstanceOf(problem,interpretation,element,type); | ||
58644 | } | ||
58645 | private pattern scopeDisallowsNewFunctionalArchitectureModel_class_UndefinedPart(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
58646 | find interpretation(problem,interpretation); | ||
58647 | PartialInterpretation.scopes(interpretation,scope); | ||
58648 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
58649 | Scope.maxNewElements(scope,0); | ||
58650 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
58651 | Type.name(type,"FunctionalArchitectureModel class UndefinedPart"); | ||
58652 | } | ||
58653 | |||
58654 | /** | ||
58655 | * An element may be an instance of type "FunctionalArchitectureModel class UndefinedPart". | ||
58656 | */ | ||
58657 | private pattern mayInstanceOfFunctionalArchitectureModel_class_UndefinedPart(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
58658 | { | ||
58659 | find interpretation(problem,interpretation); | ||
58660 | PartialInterpretation.newElements(interpretation,element); | ||
58661 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
58662 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
58663 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
58664 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
58665 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
58666 | neg find scopeDisallowsNewFunctionalArchitectureModel_class_UndefinedPart(problem, interpretation); | ||
58667 | neg find isPrimitive(element); | ||
58668 | } or { | ||
58669 | find interpretation(problem,interpretation); | ||
58670 | PartialInterpretation.openWorldElements(interpretation,element); | ||
58671 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
58672 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
58673 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
58674 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
58675 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
58676 | neg find scopeDisallowsNewFunctionalArchitectureModel_class_UndefinedPart(problem, interpretation); | ||
58677 | neg find isPrimitive(element); | ||
58678 | } or | ||
58679 | { find mustInstanceOfFunctionalArchitectureModel_class_UndefinedPart(problem,interpretation,element); } | ||
58680 | |||
58681 | ////////// | ||
58682 | // 1.2 Relation Declaration Indexers | ||
58683 | ////////// | ||
58684 | /** | ||
58685 | * Matcher for detecting tuples t where []interface reference FunctionalElement(source,target) | ||
58686 | */ | ||
58687 | private pattern mustInRelationinterface_reference_FunctionalElement( | ||
58688 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
58689 | source: DefinedElement, target:DefinedElement) | ||
58690 | { | ||
58691 | find interpretation(problem,interpretation); | ||
58692 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
58693 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"interface reference FunctionalElement"); | ||
58694 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
58695 | BinaryElementRelationLink.param1(link,source); | ||
58696 | BinaryElementRelationLink.param2(link,target); | ||
58697 | } | ||
58698 | /** | ||
58699 | * Matcher for detecting tuples t where <>interface reference FunctionalElement(source,target) | ||
58700 | */ | ||
58701 | private pattern mayInRelationinterface_reference_FunctionalElement( | ||
58702 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
58703 | source: DefinedElement, target:DefinedElement) | ||
58704 | { | ||
58705 | find interpretation(problem,interpretation); | ||
58706 | // The two endpoint of the link have to exist | ||
58707 | find mayExist(problem, interpretation, source); | ||
58708 | find mayExist(problem, interpretation, target); | ||
58709 | // Type consistency | ||
58710 | find mayInstanceOfFunctionalElement_class(problem,interpretation,source); | ||
58711 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,target); | ||
58712 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
58713 | // the upper bound of the multiplicity should be considered. | ||
58714 | numberOfExistingReferences == count find mustInRelationinterface_reference_FunctionalElement(problem,interpretation,source,_); | ||
58715 | check(numberOfExistingReferences < 1); | ||
58716 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
58717 | // the upper bound of the opposite reference multiplicity should be considered. | ||
58718 | numberOfExistingOppositeReferences == count find mustInRelationelement_reference_FunctionalInterface(problem,interpretation,target,_); | ||
58719 | check(numberOfExistingOppositeReferences < 1); | ||
58720 | // The reference is containment, then a new reference cannot be create if: | ||
58721 | // 1. Multiple parents | ||
58722 | neg find mustContains4(problem,interpretation,_,target); | ||
58723 | // 2. Circle in the containment hierarchy | ||
58724 | neg find mustTransitiveContains(source,target); | ||
58725 | } or { | ||
58726 | find mustInRelationinterface_reference_FunctionalElement(problem,interpretation,source,target); | ||
58727 | } | ||
58728 | /** | ||
58729 | * Matcher for detecting tuples t where []model reference FunctionalElement(source,target) | ||
58730 | */ | ||
58731 | private pattern mustInRelationmodel_reference_FunctionalElement( | ||
58732 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
58733 | source: DefinedElement, target:DefinedElement) | ||
58734 | { | ||
58735 | find interpretation(problem,interpretation); | ||
58736 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
58737 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"model reference FunctionalElement"); | ||
58738 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
58739 | BinaryElementRelationLink.param1(link,source); | ||
58740 | BinaryElementRelationLink.param2(link,target); | ||
58741 | } | ||
58742 | /** | ||
58743 | * Matcher for detecting tuples t where <>model reference FunctionalElement(source,target) | ||
58744 | */ | ||
58745 | private pattern mayInRelationmodel_reference_FunctionalElement( | ||
58746 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
58747 | source: DefinedElement, target:DefinedElement) | ||
58748 | { | ||
58749 | find interpretation(problem,interpretation); | ||
58750 | // The two endpoint of the link have to exist | ||
58751 | find mayExist(problem, interpretation, source); | ||
58752 | find mayExist(problem, interpretation, target); | ||
58753 | // Type consistency | ||
58754 | find mayInstanceOfFunctionalElement_class(problem,interpretation,source); | ||
58755 | find mayInstanceOfFunctionalArchitectureModel_class(problem,interpretation,target); | ||
58756 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
58757 | // the upper bound of the multiplicity should be considered. | ||
58758 | numberOfExistingReferences == count find mustInRelationmodel_reference_FunctionalElement(problem,interpretation,source,_); | ||
58759 | check(numberOfExistingReferences < 1); | ||
58760 | } or { | ||
58761 | find mustInRelationmodel_reference_FunctionalElement(problem,interpretation,source,target); | ||
58762 | } | ||
58763 | /** | ||
58764 | * Matcher for detecting tuples t where []parent reference FunctionalElement(source,target) | ||
58765 | */ | ||
58766 | private pattern mustInRelationparent_reference_FunctionalElement( | ||
58767 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
58768 | source: DefinedElement, target:DefinedElement) | ||
58769 | { | ||
58770 | find interpretation(problem,interpretation); | ||
58771 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
58772 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"parent reference FunctionalElement"); | ||
58773 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
58774 | BinaryElementRelationLink.param1(link,source); | ||
58775 | BinaryElementRelationLink.param2(link,target); | ||
58776 | } | ||
58777 | /** | ||
58778 | * Matcher for detecting tuples t where <>parent reference FunctionalElement(source,target) | ||
58779 | */ | ||
58780 | private pattern mayInRelationparent_reference_FunctionalElement( | ||
58781 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
58782 | source: DefinedElement, target:DefinedElement) | ||
58783 | { | ||
58784 | find interpretation(problem,interpretation); | ||
58785 | // The two endpoint of the link have to exist | ||
58786 | find mayExist(problem, interpretation, source); | ||
58787 | find mayExist(problem, interpretation, target); | ||
58788 | // Type consistency | ||
58789 | find mayInstanceOfFunctionalElement_class(problem,interpretation,source); | ||
58790 | find mayInstanceOfFunction_class(problem,interpretation,target); | ||
58791 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
58792 | // the upper bound of the multiplicity should be considered. | ||
58793 | numberOfExistingReferences == count find mustInRelationparent_reference_FunctionalElement(problem,interpretation,source,_); | ||
58794 | check(numberOfExistingReferences < 1); | ||
58795 | // The eOpposite of the reference is containment, then a referene cannot be created if | ||
58796 | // 1. Multiple parents | ||
58797 | neg find mustContains4(problem,interpretation,source,_); | ||
58798 | // 2. Circle in the containment hierarchy | ||
58799 | neg find mustTransitiveContains(source,target); | ||
58800 | } or { | ||
58801 | find mustInRelationparent_reference_FunctionalElement(problem,interpretation,source,target); | ||
58802 | } | ||
58803 | /** | ||
58804 | * Matcher for detecting tuples t where []rootElements reference FunctionalArchitectureModel(source,target) | ||
58805 | */ | ||
58806 | private pattern mustInRelationrootElements_reference_FunctionalArchitectureModel( | ||
58807 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
58808 | source: DefinedElement, target:DefinedElement) | ||
58809 | { | ||
58810 | find interpretation(problem,interpretation); | ||
58811 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
58812 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"rootElements reference FunctionalArchitectureModel"); | ||
58813 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
58814 | BinaryElementRelationLink.param1(link,source); | ||
58815 | BinaryElementRelationLink.param2(link,target); | ||
58816 | } | ||
58817 | /** | ||
58818 | * Matcher for detecting tuples t where <>rootElements reference FunctionalArchitectureModel(source,target) | ||
58819 | */ | ||
58820 | private pattern mayInRelationrootElements_reference_FunctionalArchitectureModel( | ||
58821 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
58822 | source: DefinedElement, target:DefinedElement) | ||
58823 | { | ||
58824 | find interpretation(problem,interpretation); | ||
58825 | // The two endpoint of the link have to exist | ||
58826 | find mayExist(problem, interpretation, source); | ||
58827 | find mayExist(problem, interpretation, target); | ||
58828 | // Type consistency | ||
58829 | find mayInstanceOfFunctionalArchitectureModel_class(problem,interpretation,source); | ||
58830 | find mayInstanceOfFunctionalElement_class(problem,interpretation,target); | ||
58831 | // The reference is containment, then a new reference cannot be create if: | ||
58832 | // 1. Multiple parents | ||
58833 | neg find mustContains4(problem,interpretation,_,target); | ||
58834 | // 2. Circle in the containment hierarchy | ||
58835 | neg find mustTransitiveContains(source,target); | ||
58836 | } or { | ||
58837 | find mustInRelationrootElements_reference_FunctionalArchitectureModel(problem,interpretation,source,target); | ||
58838 | } | ||
58839 | /** | ||
58840 | * Matcher for detecting tuples t where []subElements reference Function(source,target) | ||
58841 | */ | ||
58842 | private pattern mustInRelationsubElements_reference_Function( | ||
58843 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
58844 | source: DefinedElement, target:DefinedElement) | ||
58845 | { | ||
58846 | find interpretation(problem,interpretation); | ||
58847 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
58848 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"subElements reference Function"); | ||
58849 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
58850 | BinaryElementRelationLink.param1(link,source); | ||
58851 | BinaryElementRelationLink.param2(link,target); | ||
58852 | } | ||
58853 | /** | ||
58854 | * Matcher for detecting tuples t where <>subElements reference Function(source,target) | ||
58855 | */ | ||
58856 | private pattern mayInRelationsubElements_reference_Function( | ||
58857 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
58858 | source: DefinedElement, target:DefinedElement) | ||
58859 | { | ||
58860 | find interpretation(problem,interpretation); | ||
58861 | // The two endpoint of the link have to exist | ||
58862 | find mayExist(problem, interpretation, source); | ||
58863 | find mayExist(problem, interpretation, target); | ||
58864 | // Type consistency | ||
58865 | find mayInstanceOfFunction_class(problem,interpretation,source); | ||
58866 | find mayInstanceOfFunctionalElement_class(problem,interpretation,target); | ||
58867 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
58868 | // the upper bound of the opposite reference multiplicity should be considered. | ||
58869 | numberOfExistingOppositeReferences == count find mustInRelationparent_reference_FunctionalElement(problem,interpretation,target,_); | ||
58870 | check(numberOfExistingOppositeReferences < 1); | ||
58871 | // The reference is containment, then a new reference cannot be create if: | ||
58872 | // 1. Multiple parents | ||
58873 | neg find mustContains4(problem,interpretation,_,target); | ||
58874 | // 2. Circle in the containment hierarchy | ||
58875 | neg find mustTransitiveContains(source,target); | ||
58876 | } or { | ||
58877 | find mustInRelationsubElements_reference_Function(problem,interpretation,source,target); | ||
58878 | } | ||
58879 | /** | ||
58880 | * Matcher for detecting tuples t where []data reference FAMTerminator(source,target) | ||
58881 | */ | ||
58882 | private pattern mustInRelationdata_reference_FAMTerminator( | ||
58883 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
58884 | source: DefinedElement, target:DefinedElement) | ||
58885 | { | ||
58886 | find interpretation(problem,interpretation); | ||
58887 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
58888 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"data reference FAMTerminator"); | ||
58889 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
58890 | BinaryElementRelationLink.param1(link,source); | ||
58891 | BinaryElementRelationLink.param2(link,target); | ||
58892 | } | ||
58893 | /** | ||
58894 | * Matcher for detecting tuples t where <>data reference FAMTerminator(source,target) | ||
58895 | */ | ||
58896 | private pattern mayInRelationdata_reference_FAMTerminator( | ||
58897 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
58898 | source: DefinedElement, target:DefinedElement) | ||
58899 | { | ||
58900 | find interpretation(problem,interpretation); | ||
58901 | // The two endpoint of the link have to exist | ||
58902 | find mayExist(problem, interpretation, source); | ||
58903 | find mayExist(problem, interpretation, target); | ||
58904 | // Type consistency | ||
58905 | find mayInstanceOfFAMTerminator_class(problem,interpretation,source); | ||
58906 | find mayInstanceOfFunctionalData_class(problem,interpretation,target); | ||
58907 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
58908 | // the upper bound of the multiplicity should be considered. | ||
58909 | numberOfExistingReferences == count find mustInRelationdata_reference_FAMTerminator(problem,interpretation,source,_); | ||
58910 | check(numberOfExistingReferences < 1); | ||
58911 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
58912 | // the upper bound of the opposite reference multiplicity should be considered. | ||
58913 | numberOfExistingOppositeReferences == count find mustInRelationterminator_reference_FunctionalData(problem,interpretation,target,_); | ||
58914 | check(numberOfExistingOppositeReferences < 1); | ||
58915 | // The eOpposite of the reference is containment, then a referene cannot be created if | ||
58916 | // 1. Multiple parents | ||
58917 | neg find mustContains4(problem,interpretation,source,_); | ||
58918 | // 2. Circle in the containment hierarchy | ||
58919 | neg find mustTransitiveContains(source,target); | ||
58920 | } or { | ||
58921 | find mustInRelationdata_reference_FAMTerminator(problem,interpretation,source,target); | ||
58922 | } | ||
58923 | /** | ||
58924 | * Matcher for detecting tuples t where []from reference InformationLink(source,target) | ||
58925 | */ | ||
58926 | private pattern mustInRelationfrom_reference_InformationLink( | ||
58927 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
58928 | source: DefinedElement, target:DefinedElement) | ||
58929 | { | ||
58930 | find interpretation(problem,interpretation); | ||
58931 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
58932 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"from reference InformationLink"); | ||
58933 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
58934 | BinaryElementRelationLink.param1(link,source); | ||
58935 | BinaryElementRelationLink.param2(link,target); | ||
58936 | } | ||
58937 | /** | ||
58938 | * Matcher for detecting tuples t where <>from reference InformationLink(source,target) | ||
58939 | */ | ||
58940 | private pattern mayInRelationfrom_reference_InformationLink( | ||
58941 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
58942 | source: DefinedElement, target:DefinedElement) | ||
58943 | { | ||
58944 | find interpretation(problem,interpretation); | ||
58945 | // The two endpoint of the link have to exist | ||
58946 | find mayExist(problem, interpretation, source); | ||
58947 | find mayExist(problem, interpretation, target); | ||
58948 | // Type consistency | ||
58949 | find mayInstanceOfInformationLink_class(problem,interpretation,source); | ||
58950 | find mayInstanceOfFunctionalOutput_class(problem,interpretation,target); | ||
58951 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
58952 | // the upper bound of the multiplicity should be considered. | ||
58953 | numberOfExistingReferences == count find mustInRelationfrom_reference_InformationLink(problem,interpretation,source,_); | ||
58954 | check(numberOfExistingReferences < 1); | ||
58955 | // The eOpposite of the reference is containment, then a referene cannot be created if | ||
58956 | // 1. Multiple parents | ||
58957 | neg find mustContains4(problem,interpretation,source,_); | ||
58958 | // 2. Circle in the containment hierarchy | ||
58959 | neg find mustTransitiveContains(source,target); | ||
58960 | } or { | ||
58961 | find mustInRelationfrom_reference_InformationLink(problem,interpretation,source,target); | ||
58962 | } | ||
58963 | /** | ||
58964 | * Matcher for detecting tuples t where []to reference InformationLink(source,target) | ||
58965 | */ | ||
58966 | private pattern mustInRelationto_reference_InformationLink( | ||
58967 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
58968 | source: DefinedElement, target:DefinedElement) | ||
58969 | { | ||
58970 | find interpretation(problem,interpretation); | ||
58971 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
58972 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"to reference InformationLink"); | ||
58973 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
58974 | BinaryElementRelationLink.param1(link,source); | ||
58975 | BinaryElementRelationLink.param2(link,target); | ||
58976 | } | ||
58977 | /** | ||
58978 | * Matcher for detecting tuples t where <>to reference InformationLink(source,target) | ||
58979 | */ | ||
58980 | private pattern mayInRelationto_reference_InformationLink( | ||
58981 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
58982 | source: DefinedElement, target:DefinedElement) | ||
58983 | { | ||
58984 | find interpretation(problem,interpretation); | ||
58985 | // The two endpoint of the link have to exist | ||
58986 | find mayExist(problem, interpretation, source); | ||
58987 | find mayExist(problem, interpretation, target); | ||
58988 | // Type consistency | ||
58989 | find mayInstanceOfInformationLink_class(problem,interpretation,source); | ||
58990 | find mayInstanceOfFunctionalInput_class(problem,interpretation,target); | ||
58991 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
58992 | // the upper bound of the multiplicity should be considered. | ||
58993 | numberOfExistingReferences == count find mustInRelationto_reference_InformationLink(problem,interpretation,source,_); | ||
58994 | check(numberOfExistingReferences < 1); | ||
58995 | } or { | ||
58996 | find mustInRelationto_reference_InformationLink(problem,interpretation,source,target); | ||
58997 | } | ||
58998 | /** | ||
58999 | * Matcher for detecting tuples t where []data reference FunctionalInterface(source,target) | ||
59000 | */ | ||
59001 | private pattern mustInRelationdata_reference_FunctionalInterface( | ||
59002 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
59003 | source: DefinedElement, target:DefinedElement) | ||
59004 | { | ||
59005 | find interpretation(problem,interpretation); | ||
59006 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
59007 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"data reference FunctionalInterface"); | ||
59008 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
59009 | BinaryElementRelationLink.param1(link,source); | ||
59010 | BinaryElementRelationLink.param2(link,target); | ||
59011 | } | ||
59012 | /** | ||
59013 | * Matcher for detecting tuples t where <>data reference FunctionalInterface(source,target) | ||
59014 | */ | ||
59015 | private pattern mayInRelationdata_reference_FunctionalInterface( | ||
59016 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
59017 | source: DefinedElement, target:DefinedElement) | ||
59018 | { | ||
59019 | find interpretation(problem,interpretation); | ||
59020 | // The two endpoint of the link have to exist | ||
59021 | find mayExist(problem, interpretation, source); | ||
59022 | find mayExist(problem, interpretation, target); | ||
59023 | // Type consistency | ||
59024 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,source); | ||
59025 | find mayInstanceOfFunctionalData_class(problem,interpretation,target); | ||
59026 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
59027 | // the upper bound of the opposite reference multiplicity should be considered. | ||
59028 | numberOfExistingOppositeReferences == count find mustInRelationinterface_reference_FunctionalData(problem,interpretation,target,_); | ||
59029 | check(numberOfExistingOppositeReferences < 1); | ||
59030 | // The reference is containment, then a new reference cannot be create if: | ||
59031 | // 1. Multiple parents | ||
59032 | neg find mustContains4(problem,interpretation,_,target); | ||
59033 | // 2. Circle in the containment hierarchy | ||
59034 | neg find mustTransitiveContains(source,target); | ||
59035 | } or { | ||
59036 | find mustInRelationdata_reference_FunctionalInterface(problem,interpretation,source,target); | ||
59037 | } | ||
59038 | /** | ||
59039 | * Matcher for detecting tuples t where []element reference FunctionalInterface(source,target) | ||
59040 | */ | ||
59041 | private pattern mustInRelationelement_reference_FunctionalInterface( | ||
59042 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
59043 | source: DefinedElement, target:DefinedElement) | ||
59044 | { | ||
59045 | find interpretation(problem,interpretation); | ||
59046 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
59047 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"element reference FunctionalInterface"); | ||
59048 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
59049 | BinaryElementRelationLink.param1(link,source); | ||
59050 | BinaryElementRelationLink.param2(link,target); | ||
59051 | } | ||
59052 | /** | ||
59053 | * Matcher for detecting tuples t where <>element reference FunctionalInterface(source,target) | ||
59054 | */ | ||
59055 | private pattern mayInRelationelement_reference_FunctionalInterface( | ||
59056 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
59057 | source: DefinedElement, target:DefinedElement) | ||
59058 | { | ||
59059 | find interpretation(problem,interpretation); | ||
59060 | // The two endpoint of the link have to exist | ||
59061 | find mayExist(problem, interpretation, source); | ||
59062 | find mayExist(problem, interpretation, target); | ||
59063 | // Type consistency | ||
59064 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,source); | ||
59065 | find mayInstanceOfFunctionalElement_class(problem,interpretation,target); | ||
59066 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
59067 | // the upper bound of the multiplicity should be considered. | ||
59068 | numberOfExistingReferences == count find mustInRelationelement_reference_FunctionalInterface(problem,interpretation,source,_); | ||
59069 | check(numberOfExistingReferences < 1); | ||
59070 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
59071 | // the upper bound of the opposite reference multiplicity should be considered. | ||
59072 | numberOfExistingOppositeReferences == count find mustInRelationinterface_reference_FunctionalElement(problem,interpretation,target,_); | ||
59073 | check(numberOfExistingOppositeReferences < 1); | ||
59074 | // The eOpposite of the reference is containment, then a referene cannot be created if | ||
59075 | // 1. Multiple parents | ||
59076 | neg find mustContains4(problem,interpretation,source,_); | ||
59077 | // 2. Circle in the containment hierarchy | ||
59078 | neg find mustTransitiveContains(source,target); | ||
59079 | } or { | ||
59080 | find mustInRelationelement_reference_FunctionalInterface(problem,interpretation,source,target); | ||
59081 | } | ||
59082 | /** | ||
59083 | * Matcher for detecting tuples t where []IncomingLinks reference FunctionalInput(source,target) | ||
59084 | */ | ||
59085 | private pattern mustInRelationIncomingLinks_reference_FunctionalInput( | ||
59086 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
59087 | source: DefinedElement, target:DefinedElement) | ||
59088 | { | ||
59089 | find interpretation(problem,interpretation); | ||
59090 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
59091 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"IncomingLinks reference FunctionalInput"); | ||
59092 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
59093 | BinaryElementRelationLink.param1(link,source); | ||
59094 | BinaryElementRelationLink.param2(link,target); | ||
59095 | } | ||
59096 | /** | ||
59097 | * Matcher for detecting tuples t where <>IncomingLinks reference FunctionalInput(source,target) | ||
59098 | */ | ||
59099 | private pattern mayInRelationIncomingLinks_reference_FunctionalInput( | ||
59100 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
59101 | source: DefinedElement, target:DefinedElement) | ||
59102 | { | ||
59103 | find interpretation(problem,interpretation); | ||
59104 | // The two endpoint of the link have to exist | ||
59105 | find mayExist(problem, interpretation, source); | ||
59106 | find mayExist(problem, interpretation, target); | ||
59107 | // Type consistency | ||
59108 | find mayInstanceOfFunctionalInput_class(problem,interpretation,source); | ||
59109 | find mayInstanceOfInformationLink_class(problem,interpretation,target); | ||
59110 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
59111 | // the upper bound of the opposite reference multiplicity should be considered. | ||
59112 | numberOfExistingOppositeReferences == count find mustInRelationto_reference_InformationLink(problem,interpretation,target,_); | ||
59113 | check(numberOfExistingOppositeReferences < 1); | ||
59114 | } or { | ||
59115 | find mustInRelationIncomingLinks_reference_FunctionalInput(problem,interpretation,source,target); | ||
59116 | } | ||
59117 | /** | ||
59118 | * Matcher for detecting tuples t where []outgoingLinks reference FunctionalOutput(source,target) | ||
59119 | */ | ||
59120 | private pattern mustInRelationoutgoingLinks_reference_FunctionalOutput( | ||
59121 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
59122 | source: DefinedElement, target:DefinedElement) | ||
59123 | { | ||
59124 | find interpretation(problem,interpretation); | ||
59125 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
59126 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"outgoingLinks reference FunctionalOutput"); | ||
59127 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
59128 | BinaryElementRelationLink.param1(link,source); | ||
59129 | BinaryElementRelationLink.param2(link,target); | ||
59130 | } | ||
59131 | /** | ||
59132 | * Matcher for detecting tuples t where <>outgoingLinks reference FunctionalOutput(source,target) | ||
59133 | */ | ||
59134 | private pattern mayInRelationoutgoingLinks_reference_FunctionalOutput( | ||
59135 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
59136 | source: DefinedElement, target:DefinedElement) | ||
59137 | { | ||
59138 | find interpretation(problem,interpretation); | ||
59139 | // The two endpoint of the link have to exist | ||
59140 | find mayExist(problem, interpretation, source); | ||
59141 | find mayExist(problem, interpretation, target); | ||
59142 | // Type consistency | ||
59143 | find mayInstanceOfFunctionalOutput_class(problem,interpretation,source); | ||
59144 | find mayInstanceOfInformationLink_class(problem,interpretation,target); | ||
59145 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
59146 | // the upper bound of the opposite reference multiplicity should be considered. | ||
59147 | numberOfExistingOppositeReferences == count find mustInRelationfrom_reference_InformationLink(problem,interpretation,target,_); | ||
59148 | check(numberOfExistingOppositeReferences < 1); | ||
59149 | // The reference is containment, then a new reference cannot be create if: | ||
59150 | // 1. Multiple parents | ||
59151 | neg find mustContains4(problem,interpretation,_,target); | ||
59152 | // 2. Circle in the containment hierarchy | ||
59153 | neg find mustTransitiveContains(source,target); | ||
59154 | } or { | ||
59155 | find mustInRelationoutgoingLinks_reference_FunctionalOutput(problem,interpretation,source,target); | ||
59156 | } | ||
59157 | /** | ||
59158 | * Matcher for detecting tuples t where []terminator reference FunctionalData(source,target) | ||
59159 | */ | ||
59160 | private pattern mustInRelationterminator_reference_FunctionalData( | ||
59161 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
59162 | source: DefinedElement, target:DefinedElement) | ||
59163 | { | ||
59164 | find interpretation(problem,interpretation); | ||
59165 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
59166 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"terminator reference FunctionalData"); | ||
59167 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
59168 | BinaryElementRelationLink.param1(link,source); | ||
59169 | BinaryElementRelationLink.param2(link,target); | ||
59170 | } | ||
59171 | /** | ||
59172 | * Matcher for detecting tuples t where <>terminator reference FunctionalData(source,target) | ||
59173 | */ | ||
59174 | private pattern mayInRelationterminator_reference_FunctionalData( | ||
59175 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
59176 | source: DefinedElement, target:DefinedElement) | ||
59177 | { | ||
59178 | find interpretation(problem,interpretation); | ||
59179 | // The two endpoint of the link have to exist | ||
59180 | find mayExist(problem, interpretation, source); | ||
59181 | find mayExist(problem, interpretation, target); | ||
59182 | // Type consistency | ||
59183 | find mayInstanceOfFunctionalData_class(problem,interpretation,source); | ||
59184 | find mayInstanceOfFAMTerminator_class(problem,interpretation,target); | ||
59185 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
59186 | // the upper bound of the multiplicity should be considered. | ||
59187 | numberOfExistingReferences == count find mustInRelationterminator_reference_FunctionalData(problem,interpretation,source,_); | ||
59188 | check(numberOfExistingReferences < 1); | ||
59189 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
59190 | // the upper bound of the opposite reference multiplicity should be considered. | ||
59191 | numberOfExistingOppositeReferences == count find mustInRelationdata_reference_FAMTerminator(problem,interpretation,target,_); | ||
59192 | check(numberOfExistingOppositeReferences < 1); | ||
59193 | // The reference is containment, then a new reference cannot be create if: | ||
59194 | // 1. Multiple parents | ||
59195 | neg find mustContains4(problem,interpretation,_,target); | ||
59196 | // 2. Circle in the containment hierarchy | ||
59197 | neg find mustTransitiveContains(source,target); | ||
59198 | } or { | ||
59199 | find mustInRelationterminator_reference_FunctionalData(problem,interpretation,source,target); | ||
59200 | } | ||
59201 | /** | ||
59202 | * Matcher for detecting tuples t where []interface reference FunctionalData(source,target) | ||
59203 | */ | ||
59204 | private pattern mustInRelationinterface_reference_FunctionalData( | ||
59205 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
59206 | source: DefinedElement, target:DefinedElement) | ||
59207 | { | ||
59208 | find interpretation(problem,interpretation); | ||
59209 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
59210 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"interface reference FunctionalData"); | ||
59211 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
59212 | BinaryElementRelationLink.param1(link,source); | ||
59213 | BinaryElementRelationLink.param2(link,target); | ||
59214 | } | ||
59215 | /** | ||
59216 | * Matcher for detecting tuples t where <>interface reference FunctionalData(source,target) | ||
59217 | */ | ||
59218 | private pattern mayInRelationinterface_reference_FunctionalData( | ||
59219 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
59220 | source: DefinedElement, target:DefinedElement) | ||
59221 | { | ||
59222 | find interpretation(problem,interpretation); | ||
59223 | // The two endpoint of the link have to exist | ||
59224 | find mayExist(problem, interpretation, source); | ||
59225 | find mayExist(problem, interpretation, target); | ||
59226 | // Type consistency | ||
59227 | find mayInstanceOfFunctionalData_class(problem,interpretation,source); | ||
59228 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,target); | ||
59229 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
59230 | // the upper bound of the multiplicity should be considered. | ||
59231 | numberOfExistingReferences == count find mustInRelationinterface_reference_FunctionalData(problem,interpretation,source,_); | ||
59232 | check(numberOfExistingReferences < 1); | ||
59233 | // The eOpposite of the reference is containment, then a referene cannot be created if | ||
59234 | // 1. Multiple parents | ||
59235 | neg find mustContains4(problem,interpretation,source,_); | ||
59236 | // 2. Circle in the containment hierarchy | ||
59237 | neg find mustTransitiveContains(source,target); | ||
59238 | } or { | ||
59239 | find mustInRelationinterface_reference_FunctionalData(problem,interpretation,source,target); | ||
59240 | } | ||
59241 | /** | ||
59242 | * Matcher for detecting tuples t where []type attribute Function(source,target) | ||
59243 | */ | ||
59244 | private pattern mustInRelationtype_attribute_Function( | ||
59245 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
59246 | source: DefinedElement, target:DefinedElement) | ||
59247 | { | ||
59248 | find interpretation(problem,interpretation); | ||
59249 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
59250 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"type attribute Function"); | ||
59251 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
59252 | BinaryElementRelationLink.param1(link,source); | ||
59253 | BinaryElementRelationLink.param2(link,target); | ||
59254 | } | ||
59255 | /** | ||
59256 | * Matcher for detecting tuples t where <>type attribute Function(source,target) | ||
59257 | */ | ||
59258 | private pattern mayInRelationtype_attribute_Function( | ||
59259 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
59260 | source: DefinedElement, target:DefinedElement) | ||
59261 | { | ||
59262 | find interpretation(problem,interpretation); | ||
59263 | // The two endpoint of the link have to exist | ||
59264 | find mayExist(problem, interpretation, source); | ||
59265 | find mayExist(problem, interpretation, target); | ||
59266 | // Type consistency | ||
59267 | find mayInstanceOfFunction_class(problem,interpretation,source); | ||
59268 | find mayInstanceOfFunctionType_enum(problem,interpretation,target); | ||
59269 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
59270 | // the upper bound of the multiplicity should be considered. | ||
59271 | numberOfExistingReferences == count find mustInRelationtype_attribute_Function(problem,interpretation,source,_); | ||
59272 | check(numberOfExistingReferences < 1); | ||
59273 | } or { | ||
59274 | find mustInRelationtype_attribute_Function(problem,interpretation,source,target); | ||
59275 | } | ||
59276 | |||
59277 | ////////// | ||
59278 | // 1.3 Relation Definition Indexers | ||
59279 | ////////// | ||
59280 | |||
59281 | ////////// | ||
59282 | // 1.4 Containment Indexer | ||
59283 | ////////// | ||
59284 | private pattern mustContains2(source: DefinedElement, target: DefinedElement) { | ||
59285 | find mustContains4(_,_,source,target); | ||
59286 | } | ||
59287 | |||
59288 | private pattern mustContains4(problem:LogicProblem, interpretation:PartialInterpretation, | ||
59289 | source: DefinedElement, target: DefinedElement) | ||
59290 | { find mustInRelationinterface_reference_FunctionalElement(problem,interpretation,source,target); }or | ||
59291 | |||
59292 | { find mustInRelationrootElements_reference_FunctionalArchitectureModel(problem,interpretation,source,target); }or | ||
59293 | |||
59294 | { find mustInRelationsubElements_reference_Function(problem,interpretation,source,target); }or | ||
59295 | |||
59296 | { find mustInRelationdata_reference_FunctionalInterface(problem,interpretation,source,target); }or | ||
59297 | |||
59298 | { find mustInRelationoutgoingLinks_reference_FunctionalOutput(problem,interpretation,source,target); }or | ||
59299 | |||
59300 | { find mustInRelationterminator_reference_FunctionalData(problem,interpretation,source,target); } | ||
59301 | |||
59302 | private pattern mustTransitiveContains(source,target) { | ||
59303 | find mustContains2+(source,target); | ||
59304 | } | ||
59305 | |||
59306 | ////////// | ||
59307 | // 2. Invalidation Indexers | ||
59308 | ////////// | ||
59309 | // 2.1 Invalidated by WF Queries | ||
59310 | ////////// | ||
59311 | |||
59312 | ////////// | ||
59313 | // 3. Unfinishedness Indexers | ||
59314 | ////////// | ||
59315 | // 3.1 Unfinishedness Measured by Multiplicity | ||
59316 | ////////// | ||
59317 | pattern unfinishedLowerMultiplicity_model_reference_FunctionalElement(problem:LogicProblem, interpretation:PartialInterpretation, relationIterpretation:PartialRelationInterpretation, object:DefinedElement,missingMultiplicity) { | ||
59318 | find interpretation(problem,interpretation); | ||
59319 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
59320 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"model reference FunctionalElement"); | ||
59321 | find mustInstanceOfFunctionalElement_class(problem,interpretation,object); | ||
59322 | numberOfExistingReferences == count find mustInRelationmodel_reference_FunctionalElement(problem,interpretation,object,_); | ||
59323 | check(numberOfExistingReferences < 1); | ||
59324 | missingMultiplicity == eval(1-numberOfExistingReferences); | ||
59325 | } | ||
59326 | pattern unfinishedLowerMultiplicity_to_reference_InformationLink(problem:LogicProblem, interpretation:PartialInterpretation, relationIterpretation:PartialRelationInterpretation, object:DefinedElement,missingMultiplicity) { | ||
59327 | find interpretation(problem,interpretation); | ||
59328 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
59329 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"to reference InformationLink"); | ||
59330 | find mustInstanceOfInformationLink_class(problem,interpretation,object); | ||
59331 | numberOfExistingReferences == count find mustInRelationto_reference_InformationLink(problem,interpretation,object,_); | ||
59332 | check(numberOfExistingReferences < 1); | ||
59333 | missingMultiplicity == eval(1-numberOfExistingReferences); | ||
59334 | } | ||
59335 | pattern unfinishedLowerMultiplicity_type_attribute_Function(problem:LogicProblem, interpretation:PartialInterpretation, relationIterpretation:PartialRelationInterpretation, object:DefinedElement,missingMultiplicity) { | ||
59336 | find interpretation(problem,interpretation); | ||
59337 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
59338 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"type attribute Function"); | ||
59339 | find mustInstanceOfFunction_class(problem,interpretation,object); | ||
59340 | numberOfExistingReferences == count find mustInRelationtype_attribute_Function(problem,interpretation,object,_); | ||
59341 | check(numberOfExistingReferences < 1); | ||
59342 | missingMultiplicity == eval(1-numberOfExistingReferences); | ||
59343 | } | ||
59344 | |||
59345 | ////////// | ||
59346 | // 3.2 Unfinishedness Measured by WF Queries | ||
59347 | ////////// | ||
59348 | |||
59349 | ////////// | ||
59350 | // 4. Refinement Indexers | ||
59351 | ////////// | ||
59352 | // 4.1 Object constructors | ||
59353 | ////////// | ||
59354 | private pattern hasElementInContainment(problem:LogicProblem, interpretation:PartialInterpretation) | ||
59355 | { | ||
59356 | find interpretation(problem,interpretation); | ||
59357 | find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,root); | ||
59358 | find mustExist(problem, interpretation, root); | ||
59359 | }or{ | ||
59360 | find interpretation(problem,interpretation); | ||
59361 | find mustInstanceOfFunctionalInput_class(problem,interpretation,root); | ||
59362 | find mustExist(problem, interpretation, root); | ||
59363 | }or{ | ||
59364 | find interpretation(problem,interpretation); | ||
59365 | find mustInstanceOfFunctionalOutput_class(problem,interpretation,root); | ||
59366 | find mustExist(problem, interpretation, root); | ||
59367 | }or{ | ||
59368 | find interpretation(problem,interpretation); | ||
59369 | find mustInstanceOfFAMTerminator_class(problem,interpretation,root); | ||
59370 | find mustExist(problem, interpretation, root); | ||
59371 | }or{ | ||
59372 | find interpretation(problem,interpretation); | ||
59373 | find mustInstanceOfFunctionalInterface_class(problem,interpretation,root); | ||
59374 | find mustExist(problem, interpretation, root); | ||
59375 | }or{ | ||
59376 | find interpretation(problem,interpretation); | ||
59377 | find mustInstanceOfFunction_class(problem,interpretation,root); | ||
59378 | find mustExist(problem, interpretation, root); | ||
59379 | }or{ | ||
59380 | find interpretation(problem,interpretation); | ||
59381 | find mustInstanceOfInformationLink_class(problem,interpretation,root); | ||
59382 | find mustExist(problem, interpretation, root); | ||
59383 | }or{ | ||
59384 | find interpretation(problem,interpretation); | ||
59385 | find mustInstanceOfFunctionalElement_class(problem,interpretation,root); | ||
59386 | find mustExist(problem, interpretation, root); | ||
59387 | }or{ | ||
59388 | find interpretation(problem,interpretation); | ||
59389 | find mustInstanceOfFunctionalData_class(problem,interpretation,root); | ||
59390 | find mustExist(problem, interpretation, root); | ||
59391 | }or{ | ||
59392 | find interpretation(problem,interpretation); | ||
59393 | find mustInstanceOfFunctionalArchitectureModel_class_DefinedPart(problem,interpretation,root); | ||
59394 | find mustExist(problem, interpretation, root); | ||
59395 | }or{ | ||
59396 | find interpretation(problem,interpretation); | ||
59397 | find mustInstanceOfFunctionalArchitectureModel_class_UndefinedPart(problem,interpretation,root); | ||
59398 | find mustExist(problem, interpretation, root); | ||
59399 | } | ||
59400 | pattern createObject_FunctionalInterface_class_by_interface_reference_FunctionalElement_with_element_reference_FunctionalInterface( | ||
59401 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
59402 | relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
59403 | container:DefinedElement) | ||
59404 | { | ||
59405 | find interpretation(problem,interpretation); | ||
59406 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
59407 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalInterface class"); | ||
59408 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
59409 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"interface reference FunctionalElement"); | ||
59410 | PartialInterpretation.partialrelationinterpretation(interpretation,inverseInterpretation); | ||
59411 | PartialRelationInterpretation.interpretationOf.name(inverseInterpretation,"element reference FunctionalInterface"); | ||
59412 | find mustInstanceOfFunctionalElement_class(problem,interpretation,container); | ||
59413 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,newObject); | ||
59414 | find mayInRelationinterface_reference_FunctionalElement(problem,interpretation,container,newObject); | ||
59415 | find mustExist(problem, interpretation, container); | ||
59416 | neg find mustExist(problem, interpretation, newObject); | ||
59417 | } | ||
59418 | pattern createObject_FunctionalInterface_class( | ||
59419 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
59420 | typeInterpretation:PartialComplexTypeInterpretation) | ||
59421 | { | ||
59422 | find interpretation(problem,interpretation); | ||
59423 | neg find hasElementInContainment(problem,interpretation); | ||
59424 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
59425 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalInterface class"); | ||
59426 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,newObject); | ||
59427 | find mayExist(problem, interpretation, newObject); | ||
59428 | neg find mustExist(problem, interpretation, newObject); | ||
59429 | } | ||
59430 | pattern createObject_FunctionalArchitectureModel_class_UndefinedPart( | ||
59431 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
59432 | typeInterpretation:PartialComplexTypeInterpretation) | ||
59433 | { | ||
59434 | find interpretation(problem,interpretation); | ||
59435 | neg find hasElementInContainment(problem,interpretation); | ||
59436 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
59437 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalArchitectureModel class UndefinedPart"); | ||
59438 | find mayInstanceOfFunctionalArchitectureModel_class_UndefinedPart(problem,interpretation,newObject); | ||
59439 | find mayExist(problem, interpretation, newObject); | ||
59440 | neg find mustExist(problem, interpretation, newObject); | ||
59441 | } | ||
59442 | pattern createObject_Function_class_by_rootElements_reference_FunctionalArchitectureModel( | ||
59443 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
59444 | relationInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
59445 | container:DefinedElement) | ||
59446 | { | ||
59447 | find interpretation(problem,interpretation); | ||
59448 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
59449 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"Function class"); | ||
59450 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
59451 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"rootElements reference FunctionalArchitectureModel"); | ||
59452 | find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,container); | ||
59453 | find mayInstanceOfFunction_class(problem,interpretation,newObject); | ||
59454 | find mayInRelationrootElements_reference_FunctionalArchitectureModel(problem,interpretation,container,newObject); | ||
59455 | find mustExist(problem, interpretation, container); | ||
59456 | neg find mustExist(problem, interpretation, newObject); | ||
59457 | } | ||
59458 | pattern createObject_Function_class_by_subElements_reference_Function_with_parent_reference_FunctionalElement( | ||
59459 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
59460 | relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
59461 | container:DefinedElement) | ||
59462 | { | ||
59463 | find interpretation(problem,interpretation); | ||
59464 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
59465 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"Function class"); | ||
59466 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
59467 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"subElements reference Function"); | ||
59468 | PartialInterpretation.partialrelationinterpretation(interpretation,inverseInterpretation); | ||
59469 | PartialRelationInterpretation.interpretationOf.name(inverseInterpretation,"parent reference FunctionalElement"); | ||
59470 | find mustInstanceOfFunction_class(problem,interpretation,container); | ||
59471 | find mayInstanceOfFunction_class(problem,interpretation,newObject); | ||
59472 | find mayInRelationsubElements_reference_Function(problem,interpretation,container,newObject); | ||
59473 | find mustExist(problem, interpretation, container); | ||
59474 | neg find mustExist(problem, interpretation, newObject); | ||
59475 | } | ||
59476 | pattern createObject_Function_class( | ||
59477 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
59478 | typeInterpretation:PartialComplexTypeInterpretation) | ||
59479 | { | ||
59480 | find interpretation(problem,interpretation); | ||
59481 | neg find hasElementInContainment(problem,interpretation); | ||
59482 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
59483 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"Function class"); | ||
59484 | find mayInstanceOfFunction_class(problem,interpretation,newObject); | ||
59485 | find mayExist(problem, interpretation, newObject); | ||
59486 | neg find mustExist(problem, interpretation, newObject); | ||
59487 | } | ||
59488 | pattern createObject_InformationLink_class_by_outgoingLinks_reference_FunctionalOutput_with_from_reference_InformationLink( | ||
59489 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
59490 | relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
59491 | container:DefinedElement) | ||
59492 | { | ||
59493 | find interpretation(problem,interpretation); | ||
59494 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
59495 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"InformationLink class"); | ||
59496 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
59497 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"outgoingLinks reference FunctionalOutput"); | ||
59498 | PartialInterpretation.partialrelationinterpretation(interpretation,inverseInterpretation); | ||
59499 | PartialRelationInterpretation.interpretationOf.name(inverseInterpretation,"from reference InformationLink"); | ||
59500 | find mustInstanceOfFunctionalOutput_class(problem,interpretation,container); | ||
59501 | find mayInstanceOfInformationLink_class(problem,interpretation,newObject); | ||
59502 | find mayInRelationoutgoingLinks_reference_FunctionalOutput(problem,interpretation,container,newObject); | ||
59503 | find mustExist(problem, interpretation, container); | ||
59504 | neg find mustExist(problem, interpretation, newObject); | ||
59505 | } | ||
59506 | pattern createObject_InformationLink_class( | ||
59507 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
59508 | typeInterpretation:PartialComplexTypeInterpretation) | ||
59509 | { | ||
59510 | find interpretation(problem,interpretation); | ||
59511 | neg find hasElementInContainment(problem,interpretation); | ||
59512 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
59513 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"InformationLink class"); | ||
59514 | find mayInstanceOfInformationLink_class(problem,interpretation,newObject); | ||
59515 | find mayExist(problem, interpretation, newObject); | ||
59516 | neg find mustExist(problem, interpretation, newObject); | ||
59517 | } | ||
59518 | pattern createObject_FunctionalOutput_class_by_data_reference_FunctionalInterface_with_interface_reference_FunctionalData( | ||
59519 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
59520 | relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
59521 | container:DefinedElement) | ||
59522 | { | ||
59523 | find interpretation(problem,interpretation); | ||
59524 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
59525 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalOutput class"); | ||
59526 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
59527 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"data reference FunctionalInterface"); | ||
59528 | PartialInterpretation.partialrelationinterpretation(interpretation,inverseInterpretation); | ||
59529 | PartialRelationInterpretation.interpretationOf.name(inverseInterpretation,"interface reference FunctionalData"); | ||
59530 | find mustInstanceOfFunctionalInterface_class(problem,interpretation,container); | ||
59531 | find mayInstanceOfFunctionalOutput_class(problem,interpretation,newObject); | ||
59532 | find mayInRelationdata_reference_FunctionalInterface(problem,interpretation,container,newObject); | ||
59533 | find mustExist(problem, interpretation, container); | ||
59534 | neg find mustExist(problem, interpretation, newObject); | ||
59535 | } | ||
59536 | pattern createObject_FunctionalOutput_class( | ||
59537 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
59538 | typeInterpretation:PartialComplexTypeInterpretation) | ||
59539 | { | ||
59540 | find interpretation(problem,interpretation); | ||
59541 | neg find hasElementInContainment(problem,interpretation); | ||
59542 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
59543 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalOutput class"); | ||
59544 | find mayInstanceOfFunctionalOutput_class(problem,interpretation,newObject); | ||
59545 | find mayExist(problem, interpretation, newObject); | ||
59546 | neg find mustExist(problem, interpretation, newObject); | ||
59547 | } | ||
59548 | pattern createObject_FunctionalInput_class_by_data_reference_FunctionalInterface_with_interface_reference_FunctionalData( | ||
59549 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
59550 | relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
59551 | container:DefinedElement) | ||
59552 | { | ||
59553 | find interpretation(problem,interpretation); | ||
59554 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
59555 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalInput class"); | ||
59556 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
59557 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"data reference FunctionalInterface"); | ||
59558 | PartialInterpretation.partialrelationinterpretation(interpretation,inverseInterpretation); | ||
59559 | PartialRelationInterpretation.interpretationOf.name(inverseInterpretation,"interface reference FunctionalData"); | ||
59560 | find mustInstanceOfFunctionalInterface_class(problem,interpretation,container); | ||
59561 | find mayInstanceOfFunctionalInput_class(problem,interpretation,newObject); | ||
59562 | find mayInRelationdata_reference_FunctionalInterface(problem,interpretation,container,newObject); | ||
59563 | find mustExist(problem, interpretation, container); | ||
59564 | neg find mustExist(problem, interpretation, newObject); | ||
59565 | } | ||
59566 | pattern createObject_FunctionalInput_class( | ||
59567 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
59568 | typeInterpretation:PartialComplexTypeInterpretation) | ||
59569 | { | ||
59570 | find interpretation(problem,interpretation); | ||
59571 | neg find hasElementInContainment(problem,interpretation); | ||
59572 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
59573 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalInput class"); | ||
59574 | find mayInstanceOfFunctionalInput_class(problem,interpretation,newObject); | ||
59575 | find mayExist(problem, interpretation, newObject); | ||
59576 | neg find mustExist(problem, interpretation, newObject); | ||
59577 | } | ||
59578 | pattern createObject_FAMTerminator_class_by_terminator_reference_FunctionalData_with_data_reference_FAMTerminator( | ||
59579 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
59580 | relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
59581 | container:DefinedElement) | ||
59582 | { | ||
59583 | find interpretation(problem,interpretation); | ||
59584 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
59585 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FAMTerminator class"); | ||
59586 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
59587 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"terminator reference FunctionalData"); | ||
59588 | PartialInterpretation.partialrelationinterpretation(interpretation,inverseInterpretation); | ||
59589 | PartialRelationInterpretation.interpretationOf.name(inverseInterpretation,"data reference FAMTerminator"); | ||
59590 | find mustInstanceOfFunctionalData_class(problem,interpretation,container); | ||
59591 | find mayInstanceOfFAMTerminator_class(problem,interpretation,newObject); | ||
59592 | find mayInRelationterminator_reference_FunctionalData(problem,interpretation,container,newObject); | ||
59593 | find mustExist(problem, interpretation, container); | ||
59594 | neg find mustExist(problem, interpretation, newObject); | ||
59595 | } | ||
59596 | pattern createObject_FAMTerminator_class( | ||
59597 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
59598 | typeInterpretation:PartialComplexTypeInterpretation) | ||
59599 | { | ||
59600 | find interpretation(problem,interpretation); | ||
59601 | neg find hasElementInContainment(problem,interpretation); | ||
59602 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
59603 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FAMTerminator class"); | ||
59604 | find mayInstanceOfFAMTerminator_class(problem,interpretation,newObject); | ||
59605 | find mayExist(problem, interpretation, newObject); | ||
59606 | neg find mustExist(problem, interpretation, newObject); | ||
59607 | } | ||
59608 | |||
59609 | ////////// | ||
59610 | // 4.2 Type refinement | ||
59611 | ////////// | ||
59612 | pattern refineTypeTo_FunctionalInterface_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
59613 | find interpretation(problem,interpretation); | ||
59614 | PartialInterpretation.newElements(interpretation,element); | ||
59615 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
59616 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
59617 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
59618 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
59619 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
59620 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
59621 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
59622 | } | ||
59623 | pattern refineTypeTo_FunctionalArchitectureModel_class_UndefinedPart(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
59624 | find interpretation(problem,interpretation); | ||
59625 | PartialInterpretation.newElements(interpretation,element); | ||
59626 | find mayInstanceOfFunctionalArchitectureModel_class_UndefinedPart(problem,interpretation,element); | ||
59627 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
59628 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
59629 | neg find mustInstanceOfFunctionalArchitectureModel_class_UndefinedPart(problem,interpretation,element); | ||
59630 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
59631 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
59632 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
59633 | } | ||
59634 | pattern refineTypeTo_Function_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
59635 | find interpretation(problem,interpretation); | ||
59636 | PartialInterpretation.newElements(interpretation,element); | ||
59637 | find mayInstanceOfFunction_class(problem,interpretation,element); | ||
59638 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
59639 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
59640 | neg find mustInstanceOfFunction_class(problem,interpretation,element); | ||
59641 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
59642 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
59643 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
59644 | } | ||
59645 | pattern refineTypeTo_InformationLink_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
59646 | find interpretation(problem,interpretation); | ||
59647 | PartialInterpretation.newElements(interpretation,element); | ||
59648 | find mayInstanceOfInformationLink_class(problem,interpretation,element); | ||
59649 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
59650 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
59651 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
59652 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
59653 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
59654 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
59655 | } | ||
59656 | pattern refineTypeTo_FunctionalOutput_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
59657 | find interpretation(problem,interpretation); | ||
59658 | PartialInterpretation.newElements(interpretation,element); | ||
59659 | find mayInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
59660 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
59661 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
59662 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
59663 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
59664 | neg find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
59665 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
59666 | neg find mustInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
59667 | } | ||
59668 | pattern refineTypeTo_FunctionalInput_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
59669 | find interpretation(problem,interpretation); | ||
59670 | PartialInterpretation.newElements(interpretation,element); | ||
59671 | find mayInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
59672 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
59673 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
59674 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
59675 | neg find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
59676 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
59677 | neg find mustInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
59678 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
59679 | } | ||
59680 | pattern refineTypeTo_FAMTerminator_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
59681 | find interpretation(problem,interpretation); | ||
59682 | PartialInterpretation.newElements(interpretation,element); | ||
59683 | find mayInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
59684 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
59685 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
59686 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
59687 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
59688 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
59689 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
59690 | } | ||
59691 | |||
59692 | ////////// | ||
59693 | // 4.3 Relation refinement | ||
59694 | ////////// | ||
59695 | pattern refineRelation_model_reference_FunctionalElement( | ||
59696 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
59697 | relationIterpretation:PartialRelationInterpretation, | ||
59698 | from: DefinedElement, to: DefinedElement) | ||
59699 | { | ||
59700 | find interpretation(problem,interpretation); | ||
59701 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
59702 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"model reference FunctionalElement"); | ||
59703 | find mustExist(problem, interpretation, from); | ||
59704 | find mustExist(problem, interpretation, to); | ||
59705 | find mustInstanceOfFunctionalElement_class(problem,interpretation,from); | ||
59706 | find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,to); | ||
59707 | find mayInRelationmodel_reference_FunctionalElement(problem,interpretation,from,to); | ||
59708 | neg find mustInRelationmodel_reference_FunctionalElement(problem,interpretation,from,to); | ||
59709 | } | ||
59710 | pattern refineRelation_IncomingLinks_reference_FunctionalInput_and_to_reference_InformationLink( | ||
59711 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
59712 | relationIterpretation:PartialRelationInterpretation, oppositeInterpretation:PartialRelationInterpretation, | ||
59713 | from: DefinedElement, to: DefinedElement) | ||
59714 | { | ||
59715 | find interpretation(problem,interpretation); | ||
59716 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
59717 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"IncomingLinks reference FunctionalInput"); | ||
59718 | PartialInterpretation.partialrelationinterpretation(interpretation,oppositeInterpretation); | ||
59719 | PartialRelationInterpretation.interpretationOf.name(oppositeInterpretation,"to reference InformationLink"); | ||
59720 | find mustExist(problem, interpretation, from); | ||
59721 | find mustExist(problem, interpretation, to); | ||
59722 | find mustInstanceOfFunctionalInput_class(problem,interpretation,from); | ||
59723 | find mustInstanceOfInformationLink_class(problem,interpretation,to); | ||
59724 | find mayInRelationIncomingLinks_reference_FunctionalInput(problem,interpretation,from,to); | ||
59725 | neg find mustInRelationIncomingLinks_reference_FunctionalInput(problem,interpretation,from,to); | ||
59726 | } | ||
59727 | pattern refineRelation_type_attribute_Function( | ||
59728 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
59729 | relationIterpretation:PartialRelationInterpretation, | ||
59730 | from: DefinedElement, to: DefinedElement) | ||
59731 | { | ||
59732 | find interpretation(problem,interpretation); | ||
59733 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
59734 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"type attribute Function"); | ||
59735 | find mustExist(problem, interpretation, from); | ||
59736 | find mustExist(problem, interpretation, to); | ||
59737 | find mustInstanceOfFunction_class(problem,interpretation,from); | ||
59738 | find mustInstanceOfFunctionType_enum(problem,interpretation,to); | ||
59739 | find mayInRelationtype_attribute_Function(problem,interpretation,from,to); | ||
59740 | neg find mustInRelationtype_attribute_Function(problem,interpretation,from,to); | ||
59741 | } | ||
59742 | import epackage "http://www.bme.hu/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage" | ||
59743 | import epackage "http://www.bme.hu/mit/inf/dslreasoner/logic/model/problem" | ||
59744 | import epackage "http://www.bme.hu/mit/inf/dslreasoner/logic/model/language" | ||
59745 | |||
59746 | ////////// | ||
59747 | // 0. Util | ||
59748 | ////////// | ||
59749 | private pattern interpretation(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
59750 | PartialInterpretation.problem(interpretation,problem); | ||
59751 | } | ||
59752 | |||
59753 | ///////////////////////// | ||
59754 | // 0.1 Existence | ||
59755 | ///////////////////////// | ||
59756 | private pattern mustExist(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
59757 | find interpretation(problem,interpretation); | ||
59758 | LogicProblem.elements(problem,element); | ||
59759 | } or { | ||
59760 | find interpretation(problem,interpretation); | ||
59761 | PartialInterpretation.newElements(interpretation,element); | ||
59762 | } | ||
59763 | |||
59764 | private pattern mayExist(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
59765 | find mustExist(problem,interpretation,element); | ||
59766 | } or { | ||
59767 | find interpretation(problem,interpretation); | ||
59768 | neg find elementCloseWorld(element); | ||
59769 | PartialInterpretation.openWorldElements(interpretation,element); | ||
59770 | } | ||
59771 | |||
59772 | private pattern elementCloseWorld(element:DefinedElement) { | ||
59773 | PartialInterpretation.openWorldElements(i,element); | ||
59774 | PartialInterpretation.maxNewElements(i,0); | ||
59775 | } or { | ||
59776 | Scope.targetTypeInterpretation(scope,interpretation); | ||
59777 | PartialTypeInterpratation.elements(interpretation,element); | ||
59778 | Scope.maxNewElements(scope,0); | ||
59779 | } | ||
59780 | |||
59781 | //////////////////////// | ||
59782 | // 0.2 Equivalence | ||
59783 | //////////////////////// | ||
59784 | pattern mayEquivalent(problem:LogicProblem, interpretation:PartialInterpretation, a: DefinedElement, b: DefinedElement) { | ||
59785 | find mayExist(problem,interpretation,a); | ||
59786 | find mayExist(problem,interpretation,b); | ||
59787 | a == b; | ||
59788 | } | ||
59789 | |||
59790 | //////////////////////// | ||
59791 | // 0.3 Required Patterns by TypeIndexer | ||
59792 | //////////////////////// | ||
59793 | private pattern typeInterpretation(problem:LogicProblem, interpretation:PartialInterpretation, type:TypeDeclaration, typeInterpretation:PartialComplexTypeInterpretation) { | ||
59794 | find interpretation(problem,interpretation); | ||
59795 | LogicProblem.types(problem,type); | ||
59796 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
59797 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
59798 | } | ||
59799 | |||
59800 | private pattern directInstanceOf(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement, type:Type) { | ||
59801 | find interpretation(problem,interpretation); | ||
59802 | LogicProblem.types(problem,type); | ||
59803 | TypeDefinition.elements(type,element); | ||
59804 | } or { | ||
59805 | find interpretation(problem,interpretation); | ||
59806 | find typeInterpretation(problem,interpretation,type,typeInterpretation); | ||
59807 | PartialComplexTypeInterpretation.elements(typeInterpretation,element); | ||
59808 | } | ||
59809 | |||
59810 | private pattern isPrimitive(element: PrimitiveElement) { | ||
59811 | PrimitiveElement(element); | ||
59812 | } | ||
59813 | |||
59814 | ////////// | ||
59815 | // 1. Problem-Specific Base Indexers | ||
59816 | ////////// | ||
59817 | // 1.1 Type Indexers | ||
59818 | ////////// | ||
59819 | // 1.1.1 primitive Type Indexers | ||
59820 | ////////// | ||
59821 | |||
59822 | ////////// | ||
59823 | // 1.1.2 domain-specific Type Indexers | ||
59824 | ////////// | ||
59825 | /** | ||
59826 | * An element must be an instance of type "FunctionalElement class". | ||
59827 | */ | ||
59828 | private pattern mustInstanceOfFunctionalElement_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
59829 | Type.name(type,"FunctionalElement class"); | ||
59830 | find directInstanceOf(problem,interpretation,element,type); | ||
59831 | } | ||
59832 | private pattern scopeDisallowsNewFunctionalElement_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
59833 | find interpretation(problem,interpretation); | ||
59834 | PartialInterpretation.scopes(interpretation,scope); | ||
59835 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
59836 | Scope.maxNewElements(scope,0); | ||
59837 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
59838 | Type.name(type,"FunctionalElement class"); | ||
59839 | } | ||
59840 | |||
59841 | /** | ||
59842 | * An element may be an instance of type "FunctionalElement class". | ||
59843 | */ | ||
59844 | private pattern mayInstanceOfFunctionalElement_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
59845 | { | ||
59846 | find interpretation(problem,interpretation); | ||
59847 | PartialInterpretation.newElements(interpretation,element); | ||
59848 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
59849 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
59850 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
59851 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
59852 | neg find mustInstanceOfFunction_class(problem,interpretation,element); | ||
59853 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
59854 | neg find scopeDisallowsNewFunctionalElement_class(problem, interpretation); | ||
59855 | neg find isPrimitive(element); | ||
59856 | } or { | ||
59857 | find interpretation(problem,interpretation); | ||
59858 | PartialInterpretation.openWorldElements(interpretation,element); | ||
59859 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
59860 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
59861 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
59862 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
59863 | neg find mustInstanceOfFunction_class(problem,interpretation,element); | ||
59864 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
59865 | neg find scopeDisallowsNewFunctionalElement_class(problem, interpretation); | ||
59866 | neg find isPrimitive(element); | ||
59867 | } or | ||
59868 | { find mustInstanceOfFunctionalElement_class(problem,interpretation,element); } | ||
59869 | /** | ||
59870 | * An element must be an instance of type "FunctionalArchitectureModel class". | ||
59871 | */ | ||
59872 | private pattern mustInstanceOfFunctionalArchitectureModel_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
59873 | Type.name(type,"FunctionalArchitectureModel class"); | ||
59874 | find directInstanceOf(problem,interpretation,element,type); | ||
59875 | } | ||
59876 | private pattern scopeDisallowsNewFunctionalArchitectureModel_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
59877 | find interpretation(problem,interpretation); | ||
59878 | PartialInterpretation.scopes(interpretation,scope); | ||
59879 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
59880 | Scope.maxNewElements(scope,0); | ||
59881 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
59882 | Type.name(type,"FunctionalArchitectureModel class"); | ||
59883 | } | ||
59884 | |||
59885 | /** | ||
59886 | * An element may be an instance of type "FunctionalArchitectureModel class". | ||
59887 | */ | ||
59888 | private pattern mayInstanceOfFunctionalArchitectureModel_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
59889 | { | ||
59890 | find interpretation(problem,interpretation); | ||
59891 | PartialInterpretation.newElements(interpretation,element); | ||
59892 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
59893 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
59894 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
59895 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
59896 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
59897 | neg find scopeDisallowsNewFunctionalArchitectureModel_class(problem, interpretation); | ||
59898 | neg find isPrimitive(element); | ||
59899 | } or { | ||
59900 | find interpretation(problem,interpretation); | ||
59901 | PartialInterpretation.openWorldElements(interpretation,element); | ||
59902 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
59903 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
59904 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
59905 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
59906 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
59907 | neg find scopeDisallowsNewFunctionalArchitectureModel_class(problem, interpretation); | ||
59908 | neg find isPrimitive(element); | ||
59909 | } or | ||
59910 | { find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); } | ||
59911 | /** | ||
59912 | * An element must be an instance of type "Function class". | ||
59913 | */ | ||
59914 | private pattern mustInstanceOfFunction_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
59915 | Type.name(type,"Function class"); | ||
59916 | find directInstanceOf(problem,interpretation,element,type); | ||
59917 | } | ||
59918 | private pattern scopeDisallowsNewFunction_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
59919 | find interpretation(problem,interpretation); | ||
59920 | PartialInterpretation.scopes(interpretation,scope); | ||
59921 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
59922 | Scope.maxNewElements(scope,0); | ||
59923 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
59924 | Type.name(type,"Function class"); | ||
59925 | } | ||
59926 | |||
59927 | /** | ||
59928 | * An element may be an instance of type "Function class". | ||
59929 | */ | ||
59930 | private pattern mayInstanceOfFunction_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
59931 | { | ||
59932 | find interpretation(problem,interpretation); | ||
59933 | PartialInterpretation.newElements(interpretation,element); | ||
59934 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
59935 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
59936 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
59937 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
59938 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
59939 | neg find scopeDisallowsNewFunction_class(problem, interpretation); | ||
59940 | neg find isPrimitive(element); | ||
59941 | } or { | ||
59942 | find interpretation(problem,interpretation); | ||
59943 | PartialInterpretation.openWorldElements(interpretation,element); | ||
59944 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
59945 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
59946 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
59947 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
59948 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
59949 | neg find scopeDisallowsNewFunction_class(problem, interpretation); | ||
59950 | neg find isPrimitive(element); | ||
59951 | } or | ||
59952 | { find mustInstanceOfFunction_class(problem,interpretation,element); } | ||
59953 | /** | ||
59954 | * An element must be an instance of type "FAMTerminator class". | ||
59955 | */ | ||
59956 | private pattern mustInstanceOfFAMTerminator_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
59957 | Type.name(type,"FAMTerminator class"); | ||
59958 | find directInstanceOf(problem,interpretation,element,type); | ||
59959 | } | ||
59960 | private pattern scopeDisallowsNewFAMTerminator_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
59961 | find interpretation(problem,interpretation); | ||
59962 | PartialInterpretation.scopes(interpretation,scope); | ||
59963 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
59964 | Scope.maxNewElements(scope,0); | ||
59965 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
59966 | Type.name(type,"FAMTerminator class"); | ||
59967 | } | ||
59968 | |||
59969 | /** | ||
59970 | * An element may be an instance of type "FAMTerminator class". | ||
59971 | */ | ||
59972 | private pattern mayInstanceOfFAMTerminator_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
59973 | { | ||
59974 | find interpretation(problem,interpretation); | ||
59975 | PartialInterpretation.newElements(interpretation,element); | ||
59976 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
59977 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
59978 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
59979 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
59980 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
59981 | neg find scopeDisallowsNewFAMTerminator_class(problem, interpretation); | ||
59982 | neg find isPrimitive(element); | ||
59983 | } or { | ||
59984 | find interpretation(problem,interpretation); | ||
59985 | PartialInterpretation.openWorldElements(interpretation,element); | ||
59986 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
59987 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
59988 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
59989 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
59990 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
59991 | neg find scopeDisallowsNewFAMTerminator_class(problem, interpretation); | ||
59992 | neg find isPrimitive(element); | ||
59993 | } or | ||
59994 | { find mustInstanceOfFAMTerminator_class(problem,interpretation,element); } | ||
59995 | /** | ||
59996 | * An element must be an instance of type "InformationLink class". | ||
59997 | */ | ||
59998 | private pattern mustInstanceOfInformationLink_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
59999 | Type.name(type,"InformationLink class"); | ||
60000 | find directInstanceOf(problem,interpretation,element,type); | ||
60001 | } | ||
60002 | private pattern scopeDisallowsNewInformationLink_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
60003 | find interpretation(problem,interpretation); | ||
60004 | PartialInterpretation.scopes(interpretation,scope); | ||
60005 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
60006 | Scope.maxNewElements(scope,0); | ||
60007 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
60008 | Type.name(type,"InformationLink class"); | ||
60009 | } | ||
60010 | |||
60011 | /** | ||
60012 | * An element may be an instance of type "InformationLink class". | ||
60013 | */ | ||
60014 | private pattern mayInstanceOfInformationLink_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
60015 | { | ||
60016 | find interpretation(problem,interpretation); | ||
60017 | PartialInterpretation.newElements(interpretation,element); | ||
60018 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
60019 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
60020 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
60021 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
60022 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
60023 | neg find scopeDisallowsNewInformationLink_class(problem, interpretation); | ||
60024 | neg find isPrimitive(element); | ||
60025 | } or { | ||
60026 | find interpretation(problem,interpretation); | ||
60027 | PartialInterpretation.openWorldElements(interpretation,element); | ||
60028 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
60029 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
60030 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
60031 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
60032 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
60033 | neg find scopeDisallowsNewInformationLink_class(problem, interpretation); | ||
60034 | neg find isPrimitive(element); | ||
60035 | } or | ||
60036 | { find mustInstanceOfInformationLink_class(problem,interpretation,element); } | ||
60037 | /** | ||
60038 | * An element must be an instance of type "FunctionalInterface class". | ||
60039 | */ | ||
60040 | private pattern mustInstanceOfFunctionalInterface_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
60041 | Type.name(type,"FunctionalInterface class"); | ||
60042 | find directInstanceOf(problem,interpretation,element,type); | ||
60043 | } | ||
60044 | private pattern scopeDisallowsNewFunctionalInterface_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
60045 | find interpretation(problem,interpretation); | ||
60046 | PartialInterpretation.scopes(interpretation,scope); | ||
60047 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
60048 | Scope.maxNewElements(scope,0); | ||
60049 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
60050 | Type.name(type,"FunctionalInterface class"); | ||
60051 | } | ||
60052 | |||
60053 | /** | ||
60054 | * An element may be an instance of type "FunctionalInterface class". | ||
60055 | */ | ||
60056 | private pattern mayInstanceOfFunctionalInterface_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
60057 | { | ||
60058 | find interpretation(problem,interpretation); | ||
60059 | PartialInterpretation.newElements(interpretation,element); | ||
60060 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
60061 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
60062 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
60063 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
60064 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
60065 | neg find scopeDisallowsNewFunctionalInterface_class(problem, interpretation); | ||
60066 | neg find isPrimitive(element); | ||
60067 | } or { | ||
60068 | find interpretation(problem,interpretation); | ||
60069 | PartialInterpretation.openWorldElements(interpretation,element); | ||
60070 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
60071 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
60072 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
60073 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
60074 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
60075 | neg find scopeDisallowsNewFunctionalInterface_class(problem, interpretation); | ||
60076 | neg find isPrimitive(element); | ||
60077 | } or | ||
60078 | { find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); } | ||
60079 | /** | ||
60080 | * An element must be an instance of type "FunctionalInput class". | ||
60081 | */ | ||
60082 | private pattern mustInstanceOfFunctionalInput_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
60083 | Type.name(type,"FunctionalInput class"); | ||
60084 | find directInstanceOf(problem,interpretation,element,type); | ||
60085 | } | ||
60086 | private pattern scopeDisallowsNewFunctionalInput_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
60087 | find interpretation(problem,interpretation); | ||
60088 | PartialInterpretation.scopes(interpretation,scope); | ||
60089 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
60090 | Scope.maxNewElements(scope,0); | ||
60091 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
60092 | Type.name(type,"FunctionalInput class"); | ||
60093 | } | ||
60094 | |||
60095 | /** | ||
60096 | * An element may be an instance of type "FunctionalInput class". | ||
60097 | */ | ||
60098 | private pattern mayInstanceOfFunctionalInput_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
60099 | { | ||
60100 | find interpretation(problem,interpretation); | ||
60101 | PartialInterpretation.newElements(interpretation,element); | ||
60102 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
60103 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
60104 | neg find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
60105 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
60106 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
60107 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
60108 | neg find scopeDisallowsNewFunctionalInput_class(problem, interpretation); | ||
60109 | neg find isPrimitive(element); | ||
60110 | } or { | ||
60111 | find interpretation(problem,interpretation); | ||
60112 | PartialInterpretation.openWorldElements(interpretation,element); | ||
60113 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
60114 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
60115 | neg find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
60116 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
60117 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
60118 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
60119 | neg find scopeDisallowsNewFunctionalInput_class(problem, interpretation); | ||
60120 | neg find isPrimitive(element); | ||
60121 | } or | ||
60122 | { find mustInstanceOfFunctionalInput_class(problem,interpretation,element); } | ||
60123 | /** | ||
60124 | * An element must be an instance of type "FunctionalOutput class". | ||
60125 | */ | ||
60126 | private pattern mustInstanceOfFunctionalOutput_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
60127 | Type.name(type,"FunctionalOutput class"); | ||
60128 | find directInstanceOf(problem,interpretation,element,type); | ||
60129 | } | ||
60130 | private pattern scopeDisallowsNewFunctionalOutput_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
60131 | find interpretation(problem,interpretation); | ||
60132 | PartialInterpretation.scopes(interpretation,scope); | ||
60133 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
60134 | Scope.maxNewElements(scope,0); | ||
60135 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
60136 | Type.name(type,"FunctionalOutput class"); | ||
60137 | } | ||
60138 | |||
60139 | /** | ||
60140 | * An element may be an instance of type "FunctionalOutput class". | ||
60141 | */ | ||
60142 | private pattern mayInstanceOfFunctionalOutput_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
60143 | { | ||
60144 | find interpretation(problem,interpretation); | ||
60145 | PartialInterpretation.newElements(interpretation,element); | ||
60146 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
60147 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
60148 | neg find mustInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
60149 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
60150 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
60151 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
60152 | neg find scopeDisallowsNewFunctionalOutput_class(problem, interpretation); | ||
60153 | neg find isPrimitive(element); | ||
60154 | } or { | ||
60155 | find interpretation(problem,interpretation); | ||
60156 | PartialInterpretation.openWorldElements(interpretation,element); | ||
60157 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
60158 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
60159 | neg find mustInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
60160 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
60161 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
60162 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
60163 | neg find scopeDisallowsNewFunctionalOutput_class(problem, interpretation); | ||
60164 | neg find isPrimitive(element); | ||
60165 | } or | ||
60166 | { find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); } | ||
60167 | /** | ||
60168 | * An element must be an instance of type "FunctionalData class". | ||
60169 | */ | ||
60170 | private pattern mustInstanceOfFunctionalData_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
60171 | Type.name(type,"FunctionalData class"); | ||
60172 | find directInstanceOf(problem,interpretation,element,type); | ||
60173 | } | ||
60174 | private pattern scopeDisallowsNewFunctionalData_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
60175 | find interpretation(problem,interpretation); | ||
60176 | PartialInterpretation.scopes(interpretation,scope); | ||
60177 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
60178 | Scope.maxNewElements(scope,0); | ||
60179 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
60180 | Type.name(type,"FunctionalData class"); | ||
60181 | } | ||
60182 | |||
60183 | /** | ||
60184 | * An element may be an instance of type "FunctionalData class". | ||
60185 | */ | ||
60186 | private pattern mayInstanceOfFunctionalData_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
60187 | { | ||
60188 | find interpretation(problem,interpretation); | ||
60189 | PartialInterpretation.newElements(interpretation,element); | ||
60190 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
60191 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
60192 | neg find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
60193 | neg find mustInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
60194 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
60195 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
60196 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
60197 | neg find scopeDisallowsNewFunctionalData_class(problem, interpretation); | ||
60198 | neg find isPrimitive(element); | ||
60199 | } or { | ||
60200 | find interpretation(problem,interpretation); | ||
60201 | PartialInterpretation.openWorldElements(interpretation,element); | ||
60202 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
60203 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
60204 | neg find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
60205 | neg find mustInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
60206 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
60207 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
60208 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
60209 | neg find scopeDisallowsNewFunctionalData_class(problem, interpretation); | ||
60210 | neg find isPrimitive(element); | ||
60211 | } or | ||
60212 | { find mustInstanceOfFunctionalData_class(problem,interpretation,element); } | ||
60213 | /** | ||
60214 | * An element must be an instance of type "FunctionType enum". | ||
60215 | */ | ||
60216 | private pattern mustInstanceOfFunctionType_enum(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
60217 | Type.name(type,"FunctionType enum"); | ||
60218 | find directInstanceOf(problem,interpretation,element,type); | ||
60219 | } | ||
60220 | private pattern scopeDisallowsNewFunctionType_enum(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
60221 | find interpretation(problem,interpretation); | ||
60222 | PartialInterpretation.scopes(interpretation,scope); | ||
60223 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
60224 | Scope.maxNewElements(scope,0); | ||
60225 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
60226 | Type.name(type,"FunctionType enum"); | ||
60227 | } | ||
60228 | |||
60229 | /** | ||
60230 | * An element may be an instance of type "FunctionType enum". | ||
60231 | */ | ||
60232 | private pattern mayInstanceOfFunctionType_enum(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
60233 | { find mustInstanceOfFunctionType_enum(problem,interpretation,element); } | ||
60234 | |||
60235 | ////////// | ||
60236 | // 1.2 Relation Declaration Indexers | ||
60237 | ////////// | ||
60238 | /** | ||
60239 | * Matcher for detecting tuples t where []interface reference FunctionalElement(source,target) | ||
60240 | */ | ||
60241 | private pattern mustInRelationinterface_reference_FunctionalElement( | ||
60242 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
60243 | source: DefinedElement, target:DefinedElement) | ||
60244 | { | ||
60245 | find interpretation(problem,interpretation); | ||
60246 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
60247 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"interface reference FunctionalElement"); | ||
60248 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
60249 | BinaryElementRelationLink.param1(link,source); | ||
60250 | BinaryElementRelationLink.param2(link,target); | ||
60251 | } | ||
60252 | /** | ||
60253 | * Matcher for detecting tuples t where <>interface reference FunctionalElement(source,target) | ||
60254 | */ | ||
60255 | private pattern mayInRelationinterface_reference_FunctionalElement( | ||
60256 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
60257 | source: DefinedElement, target:DefinedElement) | ||
60258 | { | ||
60259 | find interpretation(problem,interpretation); | ||
60260 | // The two endpoint of the link have to exist | ||
60261 | find mayExist(problem, interpretation, source); | ||
60262 | find mayExist(problem, interpretation, target); | ||
60263 | // Type consistency | ||
60264 | find mayInstanceOfFunctionalElement_class(problem,interpretation,source); | ||
60265 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,target); | ||
60266 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
60267 | // the upper bound of the multiplicity should be considered. | ||
60268 | numberOfExistingReferences == count find mustInRelationinterface_reference_FunctionalElement(problem,interpretation,source,_); | ||
60269 | check(numberOfExistingReferences < 1); | ||
60270 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
60271 | // the upper bound of the opposite reference multiplicity should be considered. | ||
60272 | numberOfExistingOppositeReferences == count find mustInRelationelement_reference_FunctionalInterface(problem,interpretation,target,_); | ||
60273 | check(numberOfExistingOppositeReferences < 1); | ||
60274 | // The reference is containment, then a new reference cannot be create if: | ||
60275 | // 1. Multiple parents | ||
60276 | neg find mustContains4(problem,interpretation,_,target); | ||
60277 | // 2. Circle in the containment hierarchy | ||
60278 | neg find mustTransitiveContains(source,target); | ||
60279 | } or { | ||
60280 | find mustInRelationinterface_reference_FunctionalElement(problem,interpretation,source,target); | ||
60281 | } | ||
60282 | /** | ||
60283 | * Matcher for detecting tuples t where []model reference FunctionalElement(source,target) | ||
60284 | */ | ||
60285 | private pattern mustInRelationmodel_reference_FunctionalElement( | ||
60286 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
60287 | source: DefinedElement, target:DefinedElement) | ||
60288 | { | ||
60289 | find interpretation(problem,interpretation); | ||
60290 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
60291 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"model reference FunctionalElement"); | ||
60292 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
60293 | BinaryElementRelationLink.param1(link,source); | ||
60294 | BinaryElementRelationLink.param2(link,target); | ||
60295 | } | ||
60296 | /** | ||
60297 | * Matcher for detecting tuples t where <>model reference FunctionalElement(source,target) | ||
60298 | */ | ||
60299 | private pattern mayInRelationmodel_reference_FunctionalElement( | ||
60300 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
60301 | source: DefinedElement, target:DefinedElement) | ||
60302 | { | ||
60303 | find interpretation(problem,interpretation); | ||
60304 | // The two endpoint of the link have to exist | ||
60305 | find mayExist(problem, interpretation, source); | ||
60306 | find mayExist(problem, interpretation, target); | ||
60307 | // Type consistency | ||
60308 | find mayInstanceOfFunctionalElement_class(problem,interpretation,source); | ||
60309 | find mayInstanceOfFunctionalArchitectureModel_class(problem,interpretation,target); | ||
60310 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
60311 | // the upper bound of the multiplicity should be considered. | ||
60312 | numberOfExistingReferences == count find mustInRelationmodel_reference_FunctionalElement(problem,interpretation,source,_); | ||
60313 | check(numberOfExistingReferences < 1); | ||
60314 | } or { | ||
60315 | find mustInRelationmodel_reference_FunctionalElement(problem,interpretation,source,target); | ||
60316 | } | ||
60317 | /** | ||
60318 | * Matcher for detecting tuples t where []parent reference FunctionalElement(source,target) | ||
60319 | */ | ||
60320 | private pattern mustInRelationparent_reference_FunctionalElement( | ||
60321 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
60322 | source: DefinedElement, target:DefinedElement) | ||
60323 | { | ||
60324 | find interpretation(problem,interpretation); | ||
60325 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
60326 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"parent reference FunctionalElement"); | ||
60327 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
60328 | BinaryElementRelationLink.param1(link,source); | ||
60329 | BinaryElementRelationLink.param2(link,target); | ||
60330 | } | ||
60331 | /** | ||
60332 | * Matcher for detecting tuples t where <>parent reference FunctionalElement(source,target) | ||
60333 | */ | ||
60334 | private pattern mayInRelationparent_reference_FunctionalElement( | ||
60335 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
60336 | source: DefinedElement, target:DefinedElement) | ||
60337 | { | ||
60338 | find interpretation(problem,interpretation); | ||
60339 | // The two endpoint of the link have to exist | ||
60340 | find mayExist(problem, interpretation, source); | ||
60341 | find mayExist(problem, interpretation, target); | ||
60342 | // Type consistency | ||
60343 | find mayInstanceOfFunctionalElement_class(problem,interpretation,source); | ||
60344 | find mayInstanceOfFunction_class(problem,interpretation,target); | ||
60345 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
60346 | // the upper bound of the multiplicity should be considered. | ||
60347 | numberOfExistingReferences == count find mustInRelationparent_reference_FunctionalElement(problem,interpretation,source,_); | ||
60348 | check(numberOfExistingReferences < 1); | ||
60349 | // The eOpposite of the reference is containment, then a referene cannot be created if | ||
60350 | // 1. Multiple parents | ||
60351 | neg find mustContains4(problem,interpretation,source,_); | ||
60352 | // 2. Circle in the containment hierarchy | ||
60353 | neg find mustTransitiveContains(source,target); | ||
60354 | } or { | ||
60355 | find mustInRelationparent_reference_FunctionalElement(problem,interpretation,source,target); | ||
60356 | } | ||
60357 | /** | ||
60358 | * Matcher for detecting tuples t where []rootElements reference FunctionalArchitectureModel(source,target) | ||
60359 | */ | ||
60360 | private pattern mustInRelationrootElements_reference_FunctionalArchitectureModel( | ||
60361 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
60362 | source: DefinedElement, target:DefinedElement) | ||
60363 | { | ||
60364 | find interpretation(problem,interpretation); | ||
60365 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
60366 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"rootElements reference FunctionalArchitectureModel"); | ||
60367 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
60368 | BinaryElementRelationLink.param1(link,source); | ||
60369 | BinaryElementRelationLink.param2(link,target); | ||
60370 | } | ||
60371 | /** | ||
60372 | * Matcher for detecting tuples t where <>rootElements reference FunctionalArchitectureModel(source,target) | ||
60373 | */ | ||
60374 | private pattern mayInRelationrootElements_reference_FunctionalArchitectureModel( | ||
60375 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
60376 | source: DefinedElement, target:DefinedElement) | ||
60377 | { | ||
60378 | find interpretation(problem,interpretation); | ||
60379 | // The two endpoint of the link have to exist | ||
60380 | find mayExist(problem, interpretation, source); | ||
60381 | find mayExist(problem, interpretation, target); | ||
60382 | // Type consistency | ||
60383 | find mayInstanceOfFunctionalArchitectureModel_class(problem,interpretation,source); | ||
60384 | find mayInstanceOfFunctionalElement_class(problem,interpretation,target); | ||
60385 | // The reference is containment, then a new reference cannot be create if: | ||
60386 | // 1. Multiple parents | ||
60387 | neg find mustContains4(problem,interpretation,_,target); | ||
60388 | // 2. Circle in the containment hierarchy | ||
60389 | neg find mustTransitiveContains(source,target); | ||
60390 | } or { | ||
60391 | find mustInRelationrootElements_reference_FunctionalArchitectureModel(problem,interpretation,source,target); | ||
60392 | } | ||
60393 | /** | ||
60394 | * Matcher for detecting tuples t where []subElements reference Function(source,target) | ||
60395 | */ | ||
60396 | private pattern mustInRelationsubElements_reference_Function( | ||
60397 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
60398 | source: DefinedElement, target:DefinedElement) | ||
60399 | { | ||
60400 | find interpretation(problem,interpretation); | ||
60401 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
60402 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"subElements reference Function"); | ||
60403 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
60404 | BinaryElementRelationLink.param1(link,source); | ||
60405 | BinaryElementRelationLink.param2(link,target); | ||
60406 | } | ||
60407 | /** | ||
60408 | * Matcher for detecting tuples t where <>subElements reference Function(source,target) | ||
60409 | */ | ||
60410 | private pattern mayInRelationsubElements_reference_Function( | ||
60411 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
60412 | source: DefinedElement, target:DefinedElement) | ||
60413 | { | ||
60414 | find interpretation(problem,interpretation); | ||
60415 | // The two endpoint of the link have to exist | ||
60416 | find mayExist(problem, interpretation, source); | ||
60417 | find mayExist(problem, interpretation, target); | ||
60418 | // Type consistency | ||
60419 | find mayInstanceOfFunction_class(problem,interpretation,source); | ||
60420 | find mayInstanceOfFunctionalElement_class(problem,interpretation,target); | ||
60421 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
60422 | // the upper bound of the opposite reference multiplicity should be considered. | ||
60423 | numberOfExistingOppositeReferences == count find mustInRelationparent_reference_FunctionalElement(problem,interpretation,target,_); | ||
60424 | check(numberOfExistingOppositeReferences < 1); | ||
60425 | // The reference is containment, then a new reference cannot be create if: | ||
60426 | // 1. Multiple parents | ||
60427 | neg find mustContains4(problem,interpretation,_,target); | ||
60428 | // 2. Circle in the containment hierarchy | ||
60429 | neg find mustTransitiveContains(source,target); | ||
60430 | } or { | ||
60431 | find mustInRelationsubElements_reference_Function(problem,interpretation,source,target); | ||
60432 | } | ||
60433 | /** | ||
60434 | * Matcher for detecting tuples t where []data reference FAMTerminator(source,target) | ||
60435 | */ | ||
60436 | private pattern mustInRelationdata_reference_FAMTerminator( | ||
60437 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
60438 | source: DefinedElement, target:DefinedElement) | ||
60439 | { | ||
60440 | find interpretation(problem,interpretation); | ||
60441 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
60442 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"data reference FAMTerminator"); | ||
60443 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
60444 | BinaryElementRelationLink.param1(link,source); | ||
60445 | BinaryElementRelationLink.param2(link,target); | ||
60446 | } | ||
60447 | /** | ||
60448 | * Matcher for detecting tuples t where <>data reference FAMTerminator(source,target) | ||
60449 | */ | ||
60450 | private pattern mayInRelationdata_reference_FAMTerminator( | ||
60451 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
60452 | source: DefinedElement, target:DefinedElement) | ||
60453 | { | ||
60454 | find interpretation(problem,interpretation); | ||
60455 | // The two endpoint of the link have to exist | ||
60456 | find mayExist(problem, interpretation, source); | ||
60457 | find mayExist(problem, interpretation, target); | ||
60458 | // Type consistency | ||
60459 | find mayInstanceOfFAMTerminator_class(problem,interpretation,source); | ||
60460 | find mayInstanceOfFunctionalData_class(problem,interpretation,target); | ||
60461 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
60462 | // the upper bound of the multiplicity should be considered. | ||
60463 | numberOfExistingReferences == count find mustInRelationdata_reference_FAMTerminator(problem,interpretation,source,_); | ||
60464 | check(numberOfExistingReferences < 1); | ||
60465 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
60466 | // the upper bound of the opposite reference multiplicity should be considered. | ||
60467 | numberOfExistingOppositeReferences == count find mustInRelationterminator_reference_FunctionalData(problem,interpretation,target,_); | ||
60468 | check(numberOfExistingOppositeReferences < 1); | ||
60469 | // The eOpposite of the reference is containment, then a referene cannot be created if | ||
60470 | // 1. Multiple parents | ||
60471 | neg find mustContains4(problem,interpretation,source,_); | ||
60472 | // 2. Circle in the containment hierarchy | ||
60473 | neg find mustTransitiveContains(source,target); | ||
60474 | } or { | ||
60475 | find mustInRelationdata_reference_FAMTerminator(problem,interpretation,source,target); | ||
60476 | } | ||
60477 | /** | ||
60478 | * Matcher for detecting tuples t where []from reference InformationLink(source,target) | ||
60479 | */ | ||
60480 | private pattern mustInRelationfrom_reference_InformationLink( | ||
60481 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
60482 | source: DefinedElement, target:DefinedElement) | ||
60483 | { | ||
60484 | find interpretation(problem,interpretation); | ||
60485 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
60486 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"from reference InformationLink"); | ||
60487 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
60488 | BinaryElementRelationLink.param1(link,source); | ||
60489 | BinaryElementRelationLink.param2(link,target); | ||
60490 | } | ||
60491 | /** | ||
60492 | * Matcher for detecting tuples t where <>from reference InformationLink(source,target) | ||
60493 | */ | ||
60494 | private pattern mayInRelationfrom_reference_InformationLink( | ||
60495 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
60496 | source: DefinedElement, target:DefinedElement) | ||
60497 | { | ||
60498 | find interpretation(problem,interpretation); | ||
60499 | // The two endpoint of the link have to exist | ||
60500 | find mayExist(problem, interpretation, source); | ||
60501 | find mayExist(problem, interpretation, target); | ||
60502 | // Type consistency | ||
60503 | find mayInstanceOfInformationLink_class(problem,interpretation,source); | ||
60504 | find mayInstanceOfFunctionalOutput_class(problem,interpretation,target); | ||
60505 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
60506 | // the upper bound of the multiplicity should be considered. | ||
60507 | numberOfExistingReferences == count find mustInRelationfrom_reference_InformationLink(problem,interpretation,source,_); | ||
60508 | check(numberOfExistingReferences < 1); | ||
60509 | // The eOpposite of the reference is containment, then a referene cannot be created if | ||
60510 | // 1. Multiple parents | ||
60511 | neg find mustContains4(problem,interpretation,source,_); | ||
60512 | // 2. Circle in the containment hierarchy | ||
60513 | neg find mustTransitiveContains(source,target); | ||
60514 | } or { | ||
60515 | find mustInRelationfrom_reference_InformationLink(problem,interpretation,source,target); | ||
60516 | } | ||
60517 | /** | ||
60518 | * Matcher for detecting tuples t where []to reference InformationLink(source,target) | ||
60519 | */ | ||
60520 | private pattern mustInRelationto_reference_InformationLink( | ||
60521 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
60522 | source: DefinedElement, target:DefinedElement) | ||
60523 | { | ||
60524 | find interpretation(problem,interpretation); | ||
60525 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
60526 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"to reference InformationLink"); | ||
60527 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
60528 | BinaryElementRelationLink.param1(link,source); | ||
60529 | BinaryElementRelationLink.param2(link,target); | ||
60530 | } | ||
60531 | /** | ||
60532 | * Matcher for detecting tuples t where <>to reference InformationLink(source,target) | ||
60533 | */ | ||
60534 | private pattern mayInRelationto_reference_InformationLink( | ||
60535 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
60536 | source: DefinedElement, target:DefinedElement) | ||
60537 | { | ||
60538 | find interpretation(problem,interpretation); | ||
60539 | // The two endpoint of the link have to exist | ||
60540 | find mayExist(problem, interpretation, source); | ||
60541 | find mayExist(problem, interpretation, target); | ||
60542 | // Type consistency | ||
60543 | find mayInstanceOfInformationLink_class(problem,interpretation,source); | ||
60544 | find mayInstanceOfFunctionalInput_class(problem,interpretation,target); | ||
60545 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
60546 | // the upper bound of the multiplicity should be considered. | ||
60547 | numberOfExistingReferences == count find mustInRelationto_reference_InformationLink(problem,interpretation,source,_); | ||
60548 | check(numberOfExistingReferences < 1); | ||
60549 | } or { | ||
60550 | find mustInRelationto_reference_InformationLink(problem,interpretation,source,target); | ||
60551 | } | ||
60552 | /** | ||
60553 | * Matcher for detecting tuples t where []data reference FunctionalInterface(source,target) | ||
60554 | */ | ||
60555 | private pattern mustInRelationdata_reference_FunctionalInterface( | ||
60556 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
60557 | source: DefinedElement, target:DefinedElement) | ||
60558 | { | ||
60559 | find interpretation(problem,interpretation); | ||
60560 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
60561 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"data reference FunctionalInterface"); | ||
60562 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
60563 | BinaryElementRelationLink.param1(link,source); | ||
60564 | BinaryElementRelationLink.param2(link,target); | ||
60565 | } | ||
60566 | /** | ||
60567 | * Matcher for detecting tuples t where <>data reference FunctionalInterface(source,target) | ||
60568 | */ | ||
60569 | private pattern mayInRelationdata_reference_FunctionalInterface( | ||
60570 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
60571 | source: DefinedElement, target:DefinedElement) | ||
60572 | { | ||
60573 | find interpretation(problem,interpretation); | ||
60574 | // The two endpoint of the link have to exist | ||
60575 | find mayExist(problem, interpretation, source); | ||
60576 | find mayExist(problem, interpretation, target); | ||
60577 | // Type consistency | ||
60578 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,source); | ||
60579 | find mayInstanceOfFunctionalData_class(problem,interpretation,target); | ||
60580 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
60581 | // the upper bound of the opposite reference multiplicity should be considered. | ||
60582 | numberOfExistingOppositeReferences == count find mustInRelationinterface_reference_FunctionalData(problem,interpretation,target,_); | ||
60583 | check(numberOfExistingOppositeReferences < 1); | ||
60584 | // The reference is containment, then a new reference cannot be create if: | ||
60585 | // 1. Multiple parents | ||
60586 | neg find mustContains4(problem,interpretation,_,target); | ||
60587 | // 2. Circle in the containment hierarchy | ||
60588 | neg find mustTransitiveContains(source,target); | ||
60589 | } or { | ||
60590 | find mustInRelationdata_reference_FunctionalInterface(problem,interpretation,source,target); | ||
60591 | } | ||
60592 | /** | ||
60593 | * Matcher for detecting tuples t where []element reference FunctionalInterface(source,target) | ||
60594 | */ | ||
60595 | private pattern mustInRelationelement_reference_FunctionalInterface( | ||
60596 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
60597 | source: DefinedElement, target:DefinedElement) | ||
60598 | { | ||
60599 | find interpretation(problem,interpretation); | ||
60600 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
60601 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"element reference FunctionalInterface"); | ||
60602 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
60603 | BinaryElementRelationLink.param1(link,source); | ||
60604 | BinaryElementRelationLink.param2(link,target); | ||
60605 | } | ||
60606 | /** | ||
60607 | * Matcher for detecting tuples t where <>element reference FunctionalInterface(source,target) | ||
60608 | */ | ||
60609 | private pattern mayInRelationelement_reference_FunctionalInterface( | ||
60610 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
60611 | source: DefinedElement, target:DefinedElement) | ||
60612 | { | ||
60613 | find interpretation(problem,interpretation); | ||
60614 | // The two endpoint of the link have to exist | ||
60615 | find mayExist(problem, interpretation, source); | ||
60616 | find mayExist(problem, interpretation, target); | ||
60617 | // Type consistency | ||
60618 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,source); | ||
60619 | find mayInstanceOfFunctionalElement_class(problem,interpretation,target); | ||
60620 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
60621 | // the upper bound of the multiplicity should be considered. | ||
60622 | numberOfExistingReferences == count find mustInRelationelement_reference_FunctionalInterface(problem,interpretation,source,_); | ||
60623 | check(numberOfExistingReferences < 1); | ||
60624 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
60625 | // the upper bound of the opposite reference multiplicity should be considered. | ||
60626 | numberOfExistingOppositeReferences == count find mustInRelationinterface_reference_FunctionalElement(problem,interpretation,target,_); | ||
60627 | check(numberOfExistingOppositeReferences < 1); | ||
60628 | // The eOpposite of the reference is containment, then a referene cannot be created if | ||
60629 | // 1. Multiple parents | ||
60630 | neg find mustContains4(problem,interpretation,source,_); | ||
60631 | // 2. Circle in the containment hierarchy | ||
60632 | neg find mustTransitiveContains(source,target); | ||
60633 | } or { | ||
60634 | find mustInRelationelement_reference_FunctionalInterface(problem,interpretation,source,target); | ||
60635 | } | ||
60636 | /** | ||
60637 | * Matcher for detecting tuples t where []IncomingLinks reference FunctionalInput(source,target) | ||
60638 | */ | ||
60639 | private pattern mustInRelationIncomingLinks_reference_FunctionalInput( | ||
60640 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
60641 | source: DefinedElement, target:DefinedElement) | ||
60642 | { | ||
60643 | find interpretation(problem,interpretation); | ||
60644 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
60645 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"IncomingLinks reference FunctionalInput"); | ||
60646 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
60647 | BinaryElementRelationLink.param1(link,source); | ||
60648 | BinaryElementRelationLink.param2(link,target); | ||
60649 | } | ||
60650 | /** | ||
60651 | * Matcher for detecting tuples t where <>IncomingLinks reference FunctionalInput(source,target) | ||
60652 | */ | ||
60653 | private pattern mayInRelationIncomingLinks_reference_FunctionalInput( | ||
60654 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
60655 | source: DefinedElement, target:DefinedElement) | ||
60656 | { | ||
60657 | find interpretation(problem,interpretation); | ||
60658 | // The two endpoint of the link have to exist | ||
60659 | find mayExist(problem, interpretation, source); | ||
60660 | find mayExist(problem, interpretation, target); | ||
60661 | // Type consistency | ||
60662 | find mayInstanceOfFunctionalInput_class(problem,interpretation,source); | ||
60663 | find mayInstanceOfInformationLink_class(problem,interpretation,target); | ||
60664 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
60665 | // the upper bound of the opposite reference multiplicity should be considered. | ||
60666 | numberOfExistingOppositeReferences == count find mustInRelationto_reference_InformationLink(problem,interpretation,target,_); | ||
60667 | check(numberOfExistingOppositeReferences < 1); | ||
60668 | } or { | ||
60669 | find mustInRelationIncomingLinks_reference_FunctionalInput(problem,interpretation,source,target); | ||
60670 | } | ||
60671 | /** | ||
60672 | * Matcher for detecting tuples t where []outgoingLinks reference FunctionalOutput(source,target) | ||
60673 | */ | ||
60674 | private pattern mustInRelationoutgoingLinks_reference_FunctionalOutput( | ||
60675 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
60676 | source: DefinedElement, target:DefinedElement) | ||
60677 | { | ||
60678 | find interpretation(problem,interpretation); | ||
60679 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
60680 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"outgoingLinks reference FunctionalOutput"); | ||
60681 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
60682 | BinaryElementRelationLink.param1(link,source); | ||
60683 | BinaryElementRelationLink.param2(link,target); | ||
60684 | } | ||
60685 | /** | ||
60686 | * Matcher for detecting tuples t where <>outgoingLinks reference FunctionalOutput(source,target) | ||
60687 | */ | ||
60688 | private pattern mayInRelationoutgoingLinks_reference_FunctionalOutput( | ||
60689 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
60690 | source: DefinedElement, target:DefinedElement) | ||
60691 | { | ||
60692 | find interpretation(problem,interpretation); | ||
60693 | // The two endpoint of the link have to exist | ||
60694 | find mayExist(problem, interpretation, source); | ||
60695 | find mayExist(problem, interpretation, target); | ||
60696 | // Type consistency | ||
60697 | find mayInstanceOfFunctionalOutput_class(problem,interpretation,source); | ||
60698 | find mayInstanceOfInformationLink_class(problem,interpretation,target); | ||
60699 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
60700 | // the upper bound of the opposite reference multiplicity should be considered. | ||
60701 | numberOfExistingOppositeReferences == count find mustInRelationfrom_reference_InformationLink(problem,interpretation,target,_); | ||
60702 | check(numberOfExistingOppositeReferences < 1); | ||
60703 | // The reference is containment, then a new reference cannot be create if: | ||
60704 | // 1. Multiple parents | ||
60705 | neg find mustContains4(problem,interpretation,_,target); | ||
60706 | // 2. Circle in the containment hierarchy | ||
60707 | neg find mustTransitiveContains(source,target); | ||
60708 | } or { | ||
60709 | find mustInRelationoutgoingLinks_reference_FunctionalOutput(problem,interpretation,source,target); | ||
60710 | } | ||
60711 | /** | ||
60712 | * Matcher for detecting tuples t where []terminator reference FunctionalData(source,target) | ||
60713 | */ | ||
60714 | private pattern mustInRelationterminator_reference_FunctionalData( | ||
60715 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
60716 | source: DefinedElement, target:DefinedElement) | ||
60717 | { | ||
60718 | find interpretation(problem,interpretation); | ||
60719 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
60720 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"terminator reference FunctionalData"); | ||
60721 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
60722 | BinaryElementRelationLink.param1(link,source); | ||
60723 | BinaryElementRelationLink.param2(link,target); | ||
60724 | } | ||
60725 | /** | ||
60726 | * Matcher for detecting tuples t where <>terminator reference FunctionalData(source,target) | ||
60727 | */ | ||
60728 | private pattern mayInRelationterminator_reference_FunctionalData( | ||
60729 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
60730 | source: DefinedElement, target:DefinedElement) | ||
60731 | { | ||
60732 | find interpretation(problem,interpretation); | ||
60733 | // The two endpoint of the link have to exist | ||
60734 | find mayExist(problem, interpretation, source); | ||
60735 | find mayExist(problem, interpretation, target); | ||
60736 | // Type consistency | ||
60737 | find mayInstanceOfFunctionalData_class(problem,interpretation,source); | ||
60738 | find mayInstanceOfFAMTerminator_class(problem,interpretation,target); | ||
60739 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
60740 | // the upper bound of the multiplicity should be considered. | ||
60741 | numberOfExistingReferences == count find mustInRelationterminator_reference_FunctionalData(problem,interpretation,source,_); | ||
60742 | check(numberOfExistingReferences < 1); | ||
60743 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
60744 | // the upper bound of the opposite reference multiplicity should be considered. | ||
60745 | numberOfExistingOppositeReferences == count find mustInRelationdata_reference_FAMTerminator(problem,interpretation,target,_); | ||
60746 | check(numberOfExistingOppositeReferences < 1); | ||
60747 | // The reference is containment, then a new reference cannot be create if: | ||
60748 | // 1. Multiple parents | ||
60749 | neg find mustContains4(problem,interpretation,_,target); | ||
60750 | // 2. Circle in the containment hierarchy | ||
60751 | neg find mustTransitiveContains(source,target); | ||
60752 | } or { | ||
60753 | find mustInRelationterminator_reference_FunctionalData(problem,interpretation,source,target); | ||
60754 | } | ||
60755 | /** | ||
60756 | * Matcher for detecting tuples t where []interface reference FunctionalData(source,target) | ||
60757 | */ | ||
60758 | private pattern mustInRelationinterface_reference_FunctionalData( | ||
60759 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
60760 | source: DefinedElement, target:DefinedElement) | ||
60761 | { | ||
60762 | find interpretation(problem,interpretation); | ||
60763 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
60764 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"interface reference FunctionalData"); | ||
60765 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
60766 | BinaryElementRelationLink.param1(link,source); | ||
60767 | BinaryElementRelationLink.param2(link,target); | ||
60768 | } | ||
60769 | /** | ||
60770 | * Matcher for detecting tuples t where <>interface reference FunctionalData(source,target) | ||
60771 | */ | ||
60772 | private pattern mayInRelationinterface_reference_FunctionalData( | ||
60773 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
60774 | source: DefinedElement, target:DefinedElement) | ||
60775 | { | ||
60776 | find interpretation(problem,interpretation); | ||
60777 | // The two endpoint of the link have to exist | ||
60778 | find mayExist(problem, interpretation, source); | ||
60779 | find mayExist(problem, interpretation, target); | ||
60780 | // Type consistency | ||
60781 | find mayInstanceOfFunctionalData_class(problem,interpretation,source); | ||
60782 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,target); | ||
60783 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
60784 | // the upper bound of the multiplicity should be considered. | ||
60785 | numberOfExistingReferences == count find mustInRelationinterface_reference_FunctionalData(problem,interpretation,source,_); | ||
60786 | check(numberOfExistingReferences < 1); | ||
60787 | // The eOpposite of the reference is containment, then a referene cannot be created if | ||
60788 | // 1. Multiple parents | ||
60789 | neg find mustContains4(problem,interpretation,source,_); | ||
60790 | // 2. Circle in the containment hierarchy | ||
60791 | neg find mustTransitiveContains(source,target); | ||
60792 | } or { | ||
60793 | find mustInRelationinterface_reference_FunctionalData(problem,interpretation,source,target); | ||
60794 | } | ||
60795 | /** | ||
60796 | * Matcher for detecting tuples t where []type attribute Function(source,target) | ||
60797 | */ | ||
60798 | private pattern mustInRelationtype_attribute_Function( | ||
60799 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
60800 | source: DefinedElement, target:DefinedElement) | ||
60801 | { | ||
60802 | find interpretation(problem,interpretation); | ||
60803 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
60804 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"type attribute Function"); | ||
60805 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
60806 | BinaryElementRelationLink.param1(link,source); | ||
60807 | BinaryElementRelationLink.param2(link,target); | ||
60808 | } | ||
60809 | /** | ||
60810 | * Matcher for detecting tuples t where <>type attribute Function(source,target) | ||
60811 | */ | ||
60812 | private pattern mayInRelationtype_attribute_Function( | ||
60813 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
60814 | source: DefinedElement, target:DefinedElement) | ||
60815 | { | ||
60816 | find interpretation(problem,interpretation); | ||
60817 | // The two endpoint of the link have to exist | ||
60818 | find mayExist(problem, interpretation, source); | ||
60819 | find mayExist(problem, interpretation, target); | ||
60820 | // Type consistency | ||
60821 | find mayInstanceOfFunction_class(problem,interpretation,source); | ||
60822 | find mayInstanceOfFunctionType_enum(problem,interpretation,target); | ||
60823 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
60824 | // the upper bound of the multiplicity should be considered. | ||
60825 | numberOfExistingReferences == count find mustInRelationtype_attribute_Function(problem,interpretation,source,_); | ||
60826 | check(numberOfExistingReferences < 1); | ||
60827 | } or { | ||
60828 | find mustInRelationtype_attribute_Function(problem,interpretation,source,target); | ||
60829 | } | ||
60830 | |||
60831 | ////////// | ||
60832 | // 1.3 Relation Definition Indexers | ||
60833 | ////////// | ||
60834 | |||
60835 | ////////// | ||
60836 | // 1.4 Containment Indexer | ||
60837 | ////////// | ||
60838 | private pattern mustContains2(source: DefinedElement, target: DefinedElement) { | ||
60839 | find mustContains4(_,_,source,target); | ||
60840 | } | ||
60841 | |||
60842 | private pattern mustContains4(problem:LogicProblem, interpretation:PartialInterpretation, | ||
60843 | source: DefinedElement, target: DefinedElement) | ||
60844 | { find mustInRelationinterface_reference_FunctionalElement(problem,interpretation,source,target); }or | ||
60845 | |||
60846 | { find mustInRelationrootElements_reference_FunctionalArchitectureModel(problem,interpretation,source,target); }or | ||
60847 | |||
60848 | { find mustInRelationsubElements_reference_Function(problem,interpretation,source,target); }or | ||
60849 | |||
60850 | { find mustInRelationdata_reference_FunctionalInterface(problem,interpretation,source,target); }or | ||
60851 | |||
60852 | { find mustInRelationoutgoingLinks_reference_FunctionalOutput(problem,interpretation,source,target); }or | ||
60853 | |||
60854 | { find mustInRelationterminator_reference_FunctionalData(problem,interpretation,source,target); } | ||
60855 | |||
60856 | private pattern mustTransitiveContains(source,target) { | ||
60857 | find mustContains2+(source,target); | ||
60858 | } | ||
60859 | |||
60860 | ////////// | ||
60861 | // 2. Invalidation Indexers | ||
60862 | ////////// | ||
60863 | // 2.1 Invalidated by WF Queries | ||
60864 | ////////// | ||
60865 | |||
60866 | ////////// | ||
60867 | // 3. Unfinishedness Indexers | ||
60868 | ////////// | ||
60869 | // 3.1 Unfinishedness Measured by Multiplicity | ||
60870 | ////////// | ||
60871 | pattern unfinishedLowerMultiplicity_model_reference_FunctionalElement(problem:LogicProblem, interpretation:PartialInterpretation, relationIterpretation:PartialRelationInterpretation, object:DefinedElement,missingMultiplicity) { | ||
60872 | find interpretation(problem,interpretation); | ||
60873 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
60874 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"model reference FunctionalElement"); | ||
60875 | find mustInstanceOfFunctionalElement_class(problem,interpretation,object); | ||
60876 | numberOfExistingReferences == count find mustInRelationmodel_reference_FunctionalElement(problem,interpretation,object,_); | ||
60877 | check(numberOfExistingReferences < 1); | ||
60878 | missingMultiplicity == eval(1-numberOfExistingReferences); | ||
60879 | } | ||
60880 | pattern unfinishedLowerMultiplicity_to_reference_InformationLink(problem:LogicProblem, interpretation:PartialInterpretation, relationIterpretation:PartialRelationInterpretation, object:DefinedElement,missingMultiplicity) { | ||
60881 | find interpretation(problem,interpretation); | ||
60882 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
60883 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"to reference InformationLink"); | ||
60884 | find mustInstanceOfInformationLink_class(problem,interpretation,object); | ||
60885 | numberOfExistingReferences == count find mustInRelationto_reference_InformationLink(problem,interpretation,object,_); | ||
60886 | check(numberOfExistingReferences < 1); | ||
60887 | missingMultiplicity == eval(1-numberOfExistingReferences); | ||
60888 | } | ||
60889 | pattern unfinishedLowerMultiplicity_type_attribute_Function(problem:LogicProblem, interpretation:PartialInterpretation, relationIterpretation:PartialRelationInterpretation, object:DefinedElement,missingMultiplicity) { | ||
60890 | find interpretation(problem,interpretation); | ||
60891 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
60892 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"type attribute Function"); | ||
60893 | find mustInstanceOfFunction_class(problem,interpretation,object); | ||
60894 | numberOfExistingReferences == count find mustInRelationtype_attribute_Function(problem,interpretation,object,_); | ||
60895 | check(numberOfExistingReferences < 1); | ||
60896 | missingMultiplicity == eval(1-numberOfExistingReferences); | ||
60897 | } | ||
60898 | |||
60899 | ////////// | ||
60900 | // 3.2 Unfinishedness Measured by WF Queries | ||
60901 | ////////// | ||
60902 | |||
60903 | ////////// | ||
60904 | // 4. Refinement Indexers | ||
60905 | ////////// | ||
60906 | // 4.1 Object constructors | ||
60907 | ////////// | ||
60908 | private pattern hasElementInContainment(problem:LogicProblem, interpretation:PartialInterpretation) | ||
60909 | { | ||
60910 | find interpretation(problem,interpretation); | ||
60911 | find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,root); | ||
60912 | find mustExist(problem, interpretation, root); | ||
60913 | }or{ | ||
60914 | find interpretation(problem,interpretation); | ||
60915 | find mustInstanceOfFunctionalInput_class(problem,interpretation,root); | ||
60916 | find mustExist(problem, interpretation, root); | ||
60917 | }or{ | ||
60918 | find interpretation(problem,interpretation); | ||
60919 | find mustInstanceOfFunctionalOutput_class(problem,interpretation,root); | ||
60920 | find mustExist(problem, interpretation, root); | ||
60921 | }or{ | ||
60922 | find interpretation(problem,interpretation); | ||
60923 | find mustInstanceOfFAMTerminator_class(problem,interpretation,root); | ||
60924 | find mustExist(problem, interpretation, root); | ||
60925 | }or{ | ||
60926 | find interpretation(problem,interpretation); | ||
60927 | find mustInstanceOfFunctionalInterface_class(problem,interpretation,root); | ||
60928 | find mustExist(problem, interpretation, root); | ||
60929 | }or{ | ||
60930 | find interpretation(problem,interpretation); | ||
60931 | find mustInstanceOfFunction_class(problem,interpretation,root); | ||
60932 | find mustExist(problem, interpretation, root); | ||
60933 | }or{ | ||
60934 | find interpretation(problem,interpretation); | ||
60935 | find mustInstanceOfInformationLink_class(problem,interpretation,root); | ||
60936 | find mustExist(problem, interpretation, root); | ||
60937 | }or{ | ||
60938 | find interpretation(problem,interpretation); | ||
60939 | find mustInstanceOfFunctionalElement_class(problem,interpretation,root); | ||
60940 | find mustExist(problem, interpretation, root); | ||
60941 | }or{ | ||
60942 | find interpretation(problem,interpretation); | ||
60943 | find mustInstanceOfFunctionalData_class(problem,interpretation,root); | ||
60944 | find mustExist(problem, interpretation, root); | ||
60945 | } | ||
60946 | pattern createObject_FAMTerminator_class_by_terminator_reference_FunctionalData_with_data_reference_FAMTerminator( | ||
60947 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
60948 | relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
60949 | container:DefinedElement) | ||
60950 | { | ||
60951 | find interpretation(problem,interpretation); | ||
60952 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
60953 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FAMTerminator class"); | ||
60954 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
60955 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"terminator reference FunctionalData"); | ||
60956 | PartialInterpretation.partialrelationinterpretation(interpretation,inverseInterpretation); | ||
60957 | PartialRelationInterpretation.interpretationOf.name(inverseInterpretation,"data reference FAMTerminator"); | ||
60958 | find mustInstanceOfFunctionalData_class(problem,interpretation,container); | ||
60959 | find mayInstanceOfFAMTerminator_class(problem,interpretation,newObject); | ||
60960 | find mayInRelationterminator_reference_FunctionalData(problem,interpretation,container,newObject); | ||
60961 | find mustExist(problem, interpretation, container); | ||
60962 | neg find mustExist(problem, interpretation, newObject); | ||
60963 | } | ||
60964 | pattern createObject_FAMTerminator_class( | ||
60965 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
60966 | typeInterpretation:PartialComplexTypeInterpretation) | ||
60967 | { | ||
60968 | find interpretation(problem,interpretation); | ||
60969 | neg find hasElementInContainment(problem,interpretation); | ||
60970 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
60971 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FAMTerminator class"); | ||
60972 | find mayInstanceOfFAMTerminator_class(problem,interpretation,newObject); | ||
60973 | find mayExist(problem, interpretation, newObject); | ||
60974 | neg find mustExist(problem, interpretation, newObject); | ||
60975 | } | ||
60976 | pattern createObject_FunctionalOutput_class_by_data_reference_FunctionalInterface_with_interface_reference_FunctionalData( | ||
60977 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
60978 | relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
60979 | container:DefinedElement) | ||
60980 | { | ||
60981 | find interpretation(problem,interpretation); | ||
60982 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
60983 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalOutput class"); | ||
60984 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
60985 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"data reference FunctionalInterface"); | ||
60986 | PartialInterpretation.partialrelationinterpretation(interpretation,inverseInterpretation); | ||
60987 | PartialRelationInterpretation.interpretationOf.name(inverseInterpretation,"interface reference FunctionalData"); | ||
60988 | find mustInstanceOfFunctionalInterface_class(problem,interpretation,container); | ||
60989 | find mayInstanceOfFunctionalOutput_class(problem,interpretation,newObject); | ||
60990 | find mayInRelationdata_reference_FunctionalInterface(problem,interpretation,container,newObject); | ||
60991 | find mustExist(problem, interpretation, container); | ||
60992 | neg find mustExist(problem, interpretation, newObject); | ||
60993 | } | ||
60994 | pattern createObject_FunctionalOutput_class( | ||
60995 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
60996 | typeInterpretation:PartialComplexTypeInterpretation) | ||
60997 | { | ||
60998 | find interpretation(problem,interpretation); | ||
60999 | neg find hasElementInContainment(problem,interpretation); | ||
61000 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
61001 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalOutput class"); | ||
61002 | find mayInstanceOfFunctionalOutput_class(problem,interpretation,newObject); | ||
61003 | find mayExist(problem, interpretation, newObject); | ||
61004 | neg find mustExist(problem, interpretation, newObject); | ||
61005 | } | ||
61006 | pattern createObject_FunctionalInput_class_by_data_reference_FunctionalInterface_with_interface_reference_FunctionalData( | ||
61007 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
61008 | relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
61009 | container:DefinedElement) | ||
61010 | { | ||
61011 | find interpretation(problem,interpretation); | ||
61012 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
61013 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalInput class"); | ||
61014 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
61015 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"data reference FunctionalInterface"); | ||
61016 | PartialInterpretation.partialrelationinterpretation(interpretation,inverseInterpretation); | ||
61017 | PartialRelationInterpretation.interpretationOf.name(inverseInterpretation,"interface reference FunctionalData"); | ||
61018 | find mustInstanceOfFunctionalInterface_class(problem,interpretation,container); | ||
61019 | find mayInstanceOfFunctionalInput_class(problem,interpretation,newObject); | ||
61020 | find mayInRelationdata_reference_FunctionalInterface(problem,interpretation,container,newObject); | ||
61021 | find mustExist(problem, interpretation, container); | ||
61022 | neg find mustExist(problem, interpretation, newObject); | ||
61023 | } | ||
61024 | pattern createObject_FunctionalInput_class( | ||
61025 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
61026 | typeInterpretation:PartialComplexTypeInterpretation) | ||
61027 | { | ||
61028 | find interpretation(problem,interpretation); | ||
61029 | neg find hasElementInContainment(problem,interpretation); | ||
61030 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
61031 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalInput class"); | ||
61032 | find mayInstanceOfFunctionalInput_class(problem,interpretation,newObject); | ||
61033 | find mayExist(problem, interpretation, newObject); | ||
61034 | neg find mustExist(problem, interpretation, newObject); | ||
61035 | } | ||
61036 | pattern createObject_FunctionalInterface_class_by_interface_reference_FunctionalElement_with_element_reference_FunctionalInterface( | ||
61037 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
61038 | relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
61039 | container:DefinedElement) | ||
61040 | { | ||
61041 | find interpretation(problem,interpretation); | ||
61042 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
61043 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalInterface class"); | ||
61044 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
61045 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"interface reference FunctionalElement"); | ||
61046 | PartialInterpretation.partialrelationinterpretation(interpretation,inverseInterpretation); | ||
61047 | PartialRelationInterpretation.interpretationOf.name(inverseInterpretation,"element reference FunctionalInterface"); | ||
61048 | find mustInstanceOfFunctionalElement_class(problem,interpretation,container); | ||
61049 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,newObject); | ||
61050 | find mayInRelationinterface_reference_FunctionalElement(problem,interpretation,container,newObject); | ||
61051 | find mustExist(problem, interpretation, container); | ||
61052 | neg find mustExist(problem, interpretation, newObject); | ||
61053 | } | ||
61054 | pattern createObject_FunctionalInterface_class( | ||
61055 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
61056 | typeInterpretation:PartialComplexTypeInterpretation) | ||
61057 | { | ||
61058 | find interpretation(problem,interpretation); | ||
61059 | neg find hasElementInContainment(problem,interpretation); | ||
61060 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
61061 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalInterface class"); | ||
61062 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,newObject); | ||
61063 | find mayExist(problem, interpretation, newObject); | ||
61064 | neg find mustExist(problem, interpretation, newObject); | ||
61065 | } | ||
61066 | pattern createObject_FunctionalArchitectureModel_class( | ||
61067 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
61068 | typeInterpretation:PartialComplexTypeInterpretation) | ||
61069 | { | ||
61070 | find interpretation(problem,interpretation); | ||
61071 | neg find hasElementInContainment(problem,interpretation); | ||
61072 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
61073 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalArchitectureModel class"); | ||
61074 | find mayInstanceOfFunctionalArchitectureModel_class(problem,interpretation,newObject); | ||
61075 | find mayExist(problem, interpretation, newObject); | ||
61076 | neg find mustExist(problem, interpretation, newObject); | ||
61077 | } | ||
61078 | pattern createObject_InformationLink_class_by_outgoingLinks_reference_FunctionalOutput_with_from_reference_InformationLink( | ||
61079 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
61080 | relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
61081 | container:DefinedElement) | ||
61082 | { | ||
61083 | find interpretation(problem,interpretation); | ||
61084 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
61085 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"InformationLink class"); | ||
61086 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
61087 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"outgoingLinks reference FunctionalOutput"); | ||
61088 | PartialInterpretation.partialrelationinterpretation(interpretation,inverseInterpretation); | ||
61089 | PartialRelationInterpretation.interpretationOf.name(inverseInterpretation,"from reference InformationLink"); | ||
61090 | find mustInstanceOfFunctionalOutput_class(problem,interpretation,container); | ||
61091 | find mayInstanceOfInformationLink_class(problem,interpretation,newObject); | ||
61092 | find mayInRelationoutgoingLinks_reference_FunctionalOutput(problem,interpretation,container,newObject); | ||
61093 | find mustExist(problem, interpretation, container); | ||
61094 | neg find mustExist(problem, interpretation, newObject); | ||
61095 | } | ||
61096 | pattern createObject_InformationLink_class( | ||
61097 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
61098 | typeInterpretation:PartialComplexTypeInterpretation) | ||
61099 | { | ||
61100 | find interpretation(problem,interpretation); | ||
61101 | neg find hasElementInContainment(problem,interpretation); | ||
61102 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
61103 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"InformationLink class"); | ||
61104 | find mayInstanceOfInformationLink_class(problem,interpretation,newObject); | ||
61105 | find mayExist(problem, interpretation, newObject); | ||
61106 | neg find mustExist(problem, interpretation, newObject); | ||
61107 | } | ||
61108 | pattern createObject_Function_class_by_rootElements_reference_FunctionalArchitectureModel( | ||
61109 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
61110 | relationInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
61111 | container:DefinedElement) | ||
61112 | { | ||
61113 | find interpretation(problem,interpretation); | ||
61114 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
61115 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"Function class"); | ||
61116 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
61117 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"rootElements reference FunctionalArchitectureModel"); | ||
61118 | find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,container); | ||
61119 | find mayInstanceOfFunction_class(problem,interpretation,newObject); | ||
61120 | find mayInRelationrootElements_reference_FunctionalArchitectureModel(problem,interpretation,container,newObject); | ||
61121 | find mustExist(problem, interpretation, container); | ||
61122 | neg find mustExist(problem, interpretation, newObject); | ||
61123 | } | ||
61124 | pattern createObject_Function_class_by_subElements_reference_Function_with_parent_reference_FunctionalElement( | ||
61125 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
61126 | relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
61127 | container:DefinedElement) | ||
61128 | { | ||
61129 | find interpretation(problem,interpretation); | ||
61130 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
61131 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"Function class"); | ||
61132 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
61133 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"subElements reference Function"); | ||
61134 | PartialInterpretation.partialrelationinterpretation(interpretation,inverseInterpretation); | ||
61135 | PartialRelationInterpretation.interpretationOf.name(inverseInterpretation,"parent reference FunctionalElement"); | ||
61136 | find mustInstanceOfFunction_class(problem,interpretation,container); | ||
61137 | find mayInstanceOfFunction_class(problem,interpretation,newObject); | ||
61138 | find mayInRelationsubElements_reference_Function(problem,interpretation,container,newObject); | ||
61139 | find mustExist(problem, interpretation, container); | ||
61140 | neg find mustExist(problem, interpretation, newObject); | ||
61141 | } | ||
61142 | pattern createObject_Function_class( | ||
61143 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
61144 | typeInterpretation:PartialComplexTypeInterpretation) | ||
61145 | { | ||
61146 | find interpretation(problem,interpretation); | ||
61147 | neg find hasElementInContainment(problem,interpretation); | ||
61148 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
61149 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"Function class"); | ||
61150 | find mayInstanceOfFunction_class(problem,interpretation,newObject); | ||
61151 | find mayExist(problem, interpretation, newObject); | ||
61152 | neg find mustExist(problem, interpretation, newObject); | ||
61153 | } | ||
61154 | |||
61155 | ////////// | ||
61156 | // 4.2 Type refinement | ||
61157 | ////////// | ||
61158 | pattern refineTypeTo_FAMTerminator_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
61159 | find interpretation(problem,interpretation); | ||
61160 | PartialInterpretation.newElements(interpretation,element); | ||
61161 | find mayInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
61162 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
61163 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
61164 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
61165 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
61166 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
61167 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
61168 | } | ||
61169 | pattern refineTypeTo_FunctionalOutput_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
61170 | find interpretation(problem,interpretation); | ||
61171 | PartialInterpretation.newElements(interpretation,element); | ||
61172 | find mayInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
61173 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
61174 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
61175 | neg find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
61176 | neg find mustInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
61177 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
61178 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
61179 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
61180 | } | ||
61181 | pattern refineTypeTo_FunctionalInput_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
61182 | find interpretation(problem,interpretation); | ||
61183 | PartialInterpretation.newElements(interpretation,element); | ||
61184 | find mayInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
61185 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
61186 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
61187 | neg find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
61188 | neg find mustInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
61189 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
61190 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
61191 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
61192 | } | ||
61193 | pattern refineTypeTo_FunctionalInterface_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
61194 | find interpretation(problem,interpretation); | ||
61195 | PartialInterpretation.newElements(interpretation,element); | ||
61196 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
61197 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
61198 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
61199 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
61200 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
61201 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
61202 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
61203 | } | ||
61204 | pattern refineTypeTo_FunctionalArchitectureModel_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
61205 | find interpretation(problem,interpretation); | ||
61206 | PartialInterpretation.newElements(interpretation,element); | ||
61207 | find mayInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
61208 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
61209 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
61210 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
61211 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
61212 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
61213 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
61214 | } | ||
61215 | pattern refineTypeTo_InformationLink_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
61216 | find interpretation(problem,interpretation); | ||
61217 | PartialInterpretation.newElements(interpretation,element); | ||
61218 | find mayInstanceOfInformationLink_class(problem,interpretation,element); | ||
61219 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
61220 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
61221 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
61222 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
61223 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
61224 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
61225 | } | ||
61226 | pattern refineTypeTo_Function_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
61227 | find interpretation(problem,interpretation); | ||
61228 | PartialInterpretation.newElements(interpretation,element); | ||
61229 | find mayInstanceOfFunction_class(problem,interpretation,element); | ||
61230 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
61231 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
61232 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
61233 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
61234 | neg find mustInstanceOfFunction_class(problem,interpretation,element); | ||
61235 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
61236 | } | ||
61237 | |||
61238 | ////////// | ||
61239 | // 4.3 Relation refinement | ||
61240 | ////////// | ||
61241 | pattern refineRelation_model_reference_FunctionalElement( | ||
61242 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
61243 | relationIterpretation:PartialRelationInterpretation, | ||
61244 | from: DefinedElement, to: DefinedElement) | ||
61245 | { | ||
61246 | find interpretation(problem,interpretation); | ||
61247 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
61248 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"model reference FunctionalElement"); | ||
61249 | find mustExist(problem, interpretation, from); | ||
61250 | find mustExist(problem, interpretation, to); | ||
61251 | find mustInstanceOfFunctionalElement_class(problem,interpretation,from); | ||
61252 | find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,to); | ||
61253 | find mayInRelationmodel_reference_FunctionalElement(problem,interpretation,from,to); | ||
61254 | neg find mustInRelationmodel_reference_FunctionalElement(problem,interpretation,from,to); | ||
61255 | } | ||
61256 | pattern refineRelation_IncomingLinks_reference_FunctionalInput_and_to_reference_InformationLink( | ||
61257 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
61258 | relationIterpretation:PartialRelationInterpretation, oppositeInterpretation:PartialRelationInterpretation, | ||
61259 | from: DefinedElement, to: DefinedElement) | ||
61260 | { | ||
61261 | find interpretation(problem,interpretation); | ||
61262 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
61263 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"IncomingLinks reference FunctionalInput"); | ||
61264 | PartialInterpretation.partialrelationinterpretation(interpretation,oppositeInterpretation); | ||
61265 | PartialRelationInterpretation.interpretationOf.name(oppositeInterpretation,"to reference InformationLink"); | ||
61266 | find mustExist(problem, interpretation, from); | ||
61267 | find mustExist(problem, interpretation, to); | ||
61268 | find mustInstanceOfFunctionalInput_class(problem,interpretation,from); | ||
61269 | find mustInstanceOfInformationLink_class(problem,interpretation,to); | ||
61270 | find mayInRelationIncomingLinks_reference_FunctionalInput(problem,interpretation,from,to); | ||
61271 | neg find mustInRelationIncomingLinks_reference_FunctionalInput(problem,interpretation,from,to); | ||
61272 | } | ||
61273 | pattern refineRelation_type_attribute_Function( | ||
61274 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
61275 | relationIterpretation:PartialRelationInterpretation, | ||
61276 | from: DefinedElement, to: DefinedElement) | ||
61277 | { | ||
61278 | find interpretation(problem,interpretation); | ||
61279 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
61280 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"type attribute Function"); | ||
61281 | find mustExist(problem, interpretation, from); | ||
61282 | find mustExist(problem, interpretation, to); | ||
61283 | find mustInstanceOfFunction_class(problem,interpretation,from); | ||
61284 | find mustInstanceOfFunctionType_enum(problem,interpretation,to); | ||
61285 | find mayInRelationtype_attribute_Function(problem,interpretation,from,to); | ||
61286 | neg find mustInRelationtype_attribute_Function(problem,interpretation,from,to); | ||
61287 | } | ||
61288 | import epackage "http://www.bme.hu/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage" | ||
61289 | import epackage "http://www.bme.hu/mit/inf/dslreasoner/logic/model/problem" | ||
61290 | import epackage "http://www.bme.hu/mit/inf/dslreasoner/logic/model/language" | ||
61291 | |||
61292 | ////////// | ||
61293 | // 0. Util | ||
61294 | ////////// | ||
61295 | private pattern interpretation(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
61296 | PartialInterpretation.problem(interpretation,problem); | ||
61297 | } | ||
61298 | |||
61299 | ///////////////////////// | ||
61300 | // 0.1 Existence | ||
61301 | ///////////////////////// | ||
61302 | private pattern mustExist(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
61303 | find interpretation(problem,interpretation); | ||
61304 | LogicProblem.elements(problem,element); | ||
61305 | } or { | ||
61306 | find interpretation(problem,interpretation); | ||
61307 | PartialInterpretation.newElements(interpretation,element); | ||
61308 | } | ||
61309 | |||
61310 | private pattern mayExist(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
61311 | find mustExist(problem,interpretation,element); | ||
61312 | } or { | ||
61313 | find interpretation(problem,interpretation); | ||
61314 | neg find elementCloseWorld(element); | ||
61315 | PartialInterpretation.openWorldElements(interpretation,element); | ||
61316 | } | ||
61317 | |||
61318 | private pattern elementCloseWorld(element:DefinedElement) { | ||
61319 | PartialInterpretation.openWorldElements(i,element); | ||
61320 | PartialInterpretation.maxNewElements(i,0); | ||
61321 | } or { | ||
61322 | Scope.targetTypeInterpretation(scope,interpretation); | ||
61323 | PartialTypeInterpratation.elements(interpretation,element); | ||
61324 | Scope.maxNewElements(scope,0); | ||
61325 | } | ||
61326 | |||
61327 | //////////////////////// | ||
61328 | // 0.2 Equivalence | ||
61329 | //////////////////////// | ||
61330 | pattern mayEquivalent(problem:LogicProblem, interpretation:PartialInterpretation, a: DefinedElement, b: DefinedElement) { | ||
61331 | find mayExist(problem,interpretation,a); | ||
61332 | find mayExist(problem,interpretation,b); | ||
61333 | a == b; | ||
61334 | } | ||
61335 | |||
61336 | //////////////////////// | ||
61337 | // 0.3 Required Patterns by TypeIndexer | ||
61338 | //////////////////////// | ||
61339 | private pattern typeInterpretation(problem:LogicProblem, interpretation:PartialInterpretation, type:TypeDeclaration, typeInterpretation:PartialComplexTypeInterpretation) { | ||
61340 | find interpretation(problem,interpretation); | ||
61341 | LogicProblem.types(problem,type); | ||
61342 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
61343 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
61344 | } | ||
61345 | |||
61346 | private pattern directInstanceOf(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement, type:Type) { | ||
61347 | find interpretation(problem,interpretation); | ||
61348 | LogicProblem.types(problem,type); | ||
61349 | TypeDefinition.elements(type,element); | ||
61350 | } or { | ||
61351 | find interpretation(problem,interpretation); | ||
61352 | find typeInterpretation(problem,interpretation,type,typeInterpretation); | ||
61353 | PartialComplexTypeInterpretation.elements(typeInterpretation,element); | ||
61354 | } | ||
61355 | |||
61356 | private pattern isPrimitive(element: PrimitiveElement) { | ||
61357 | PrimitiveElement(element); | ||
61358 | } | ||
61359 | |||
61360 | ////////// | ||
61361 | // 1. Problem-Specific Base Indexers | ||
61362 | ////////// | ||
61363 | // 1.1 Type Indexers | ||
61364 | ////////// | ||
61365 | // 1.1.1 primitive Type Indexers | ||
61366 | ////////// | ||
61367 | |||
61368 | ////////// | ||
61369 | // 1.1.2 domain-specific Type Indexers | ||
61370 | ////////// | ||
61371 | /** | ||
61372 | * An element must be an instance of type "FunctionalElement class". | ||
61373 | */ | ||
61374 | private pattern mustInstanceOfFunctionalElement_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
61375 | Type.name(type,"FunctionalElement class"); | ||
61376 | find directInstanceOf(problem,interpretation,element,type); | ||
61377 | } | ||
61378 | private pattern scopeDisallowsNewFunctionalElement_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
61379 | find interpretation(problem,interpretation); | ||
61380 | PartialInterpretation.scopes(interpretation,scope); | ||
61381 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
61382 | Scope.maxNewElements(scope,0); | ||
61383 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
61384 | Type.name(type,"FunctionalElement class"); | ||
61385 | } | ||
61386 | |||
61387 | /** | ||
61388 | * An element may be an instance of type "FunctionalElement class". | ||
61389 | */ | ||
61390 | private pattern mayInstanceOfFunctionalElement_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
61391 | { | ||
61392 | find interpretation(problem,interpretation); | ||
61393 | PartialInterpretation.newElements(interpretation,element); | ||
61394 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
61395 | neg find mustInstanceOfFunction_class(problem,interpretation,element); | ||
61396 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
61397 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
61398 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
61399 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
61400 | neg find scopeDisallowsNewFunctionalElement_class(problem, interpretation); | ||
61401 | neg find isPrimitive(element); | ||
61402 | } or { | ||
61403 | find interpretation(problem,interpretation); | ||
61404 | PartialInterpretation.openWorldElements(interpretation,element); | ||
61405 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
61406 | neg find mustInstanceOfFunction_class(problem,interpretation,element); | ||
61407 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
61408 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
61409 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
61410 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
61411 | neg find scopeDisallowsNewFunctionalElement_class(problem, interpretation); | ||
61412 | neg find isPrimitive(element); | ||
61413 | } or | ||
61414 | { find mustInstanceOfFunctionalElement_class(problem,interpretation,element); } | ||
61415 | /** | ||
61416 | * An element must be an instance of type "FunctionalArchitectureModel class". | ||
61417 | */ | ||
61418 | private pattern mustInstanceOfFunctionalArchitectureModel_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
61419 | Type.name(type,"FunctionalArchitectureModel class"); | ||
61420 | find directInstanceOf(problem,interpretation,element,type); | ||
61421 | } | ||
61422 | private pattern scopeDisallowsNewFunctionalArchitectureModel_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
61423 | find interpretation(problem,interpretation); | ||
61424 | PartialInterpretation.scopes(interpretation,scope); | ||
61425 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
61426 | Scope.maxNewElements(scope,0); | ||
61427 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
61428 | Type.name(type,"FunctionalArchitectureModel class"); | ||
61429 | } | ||
61430 | |||
61431 | /** | ||
61432 | * An element may be an instance of type "FunctionalArchitectureModel class". | ||
61433 | */ | ||
61434 | private pattern mayInstanceOfFunctionalArchitectureModel_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
61435 | { | ||
61436 | find interpretation(problem,interpretation); | ||
61437 | PartialInterpretation.newElements(interpretation,element); | ||
61438 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
61439 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
61440 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
61441 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
61442 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
61443 | neg find scopeDisallowsNewFunctionalArchitectureModel_class(problem, interpretation); | ||
61444 | neg find isPrimitive(element); | ||
61445 | } or { | ||
61446 | find interpretation(problem,interpretation); | ||
61447 | PartialInterpretation.openWorldElements(interpretation,element); | ||
61448 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
61449 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
61450 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
61451 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
61452 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
61453 | neg find scopeDisallowsNewFunctionalArchitectureModel_class(problem, interpretation); | ||
61454 | neg find isPrimitive(element); | ||
61455 | } or | ||
61456 | { find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); } | ||
61457 | /** | ||
61458 | * An element must be an instance of type "Function class". | ||
61459 | */ | ||
61460 | private pattern mustInstanceOfFunction_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
61461 | Type.name(type,"Function class"); | ||
61462 | find directInstanceOf(problem,interpretation,element,type); | ||
61463 | } | ||
61464 | private pattern scopeDisallowsNewFunction_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
61465 | find interpretation(problem,interpretation); | ||
61466 | PartialInterpretation.scopes(interpretation,scope); | ||
61467 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
61468 | Scope.maxNewElements(scope,0); | ||
61469 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
61470 | Type.name(type,"Function class"); | ||
61471 | } | ||
61472 | |||
61473 | /** | ||
61474 | * An element may be an instance of type "Function class". | ||
61475 | */ | ||
61476 | private pattern mayInstanceOfFunction_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
61477 | { | ||
61478 | find interpretation(problem,interpretation); | ||
61479 | PartialInterpretation.newElements(interpretation,element); | ||
61480 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
61481 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
61482 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
61483 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
61484 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
61485 | neg find scopeDisallowsNewFunction_class(problem, interpretation); | ||
61486 | neg find isPrimitive(element); | ||
61487 | } or { | ||
61488 | find interpretation(problem,interpretation); | ||
61489 | PartialInterpretation.openWorldElements(interpretation,element); | ||
61490 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
61491 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
61492 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
61493 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
61494 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
61495 | neg find scopeDisallowsNewFunction_class(problem, interpretation); | ||
61496 | neg find isPrimitive(element); | ||
61497 | } or | ||
61498 | { find mustInstanceOfFunction_class(problem,interpretation,element); } | ||
61499 | /** | ||
61500 | * An element must be an instance of type "FAMTerminator class". | ||
61501 | */ | ||
61502 | private pattern mustInstanceOfFAMTerminator_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
61503 | Type.name(type,"FAMTerminator class"); | ||
61504 | find directInstanceOf(problem,interpretation,element,type); | ||
61505 | } | ||
61506 | private pattern scopeDisallowsNewFAMTerminator_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
61507 | find interpretation(problem,interpretation); | ||
61508 | PartialInterpretation.scopes(interpretation,scope); | ||
61509 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
61510 | Scope.maxNewElements(scope,0); | ||
61511 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
61512 | Type.name(type,"FAMTerminator class"); | ||
61513 | } | ||
61514 | |||
61515 | /** | ||
61516 | * An element may be an instance of type "FAMTerminator class". | ||
61517 | */ | ||
61518 | private pattern mayInstanceOfFAMTerminator_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
61519 | { | ||
61520 | find interpretation(problem,interpretation); | ||
61521 | PartialInterpretation.newElements(interpretation,element); | ||
61522 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
61523 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
61524 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
61525 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
61526 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
61527 | neg find scopeDisallowsNewFAMTerminator_class(problem, interpretation); | ||
61528 | neg find isPrimitive(element); | ||
61529 | } or { | ||
61530 | find interpretation(problem,interpretation); | ||
61531 | PartialInterpretation.openWorldElements(interpretation,element); | ||
61532 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
61533 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
61534 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
61535 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
61536 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
61537 | neg find scopeDisallowsNewFAMTerminator_class(problem, interpretation); | ||
61538 | neg find isPrimitive(element); | ||
61539 | } or | ||
61540 | { find mustInstanceOfFAMTerminator_class(problem,interpretation,element); } | ||
61541 | /** | ||
61542 | * An element must be an instance of type "InformationLink class". | ||
61543 | */ | ||
61544 | private pattern mustInstanceOfInformationLink_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
61545 | Type.name(type,"InformationLink class"); | ||
61546 | find directInstanceOf(problem,interpretation,element,type); | ||
61547 | } | ||
61548 | private pattern scopeDisallowsNewInformationLink_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
61549 | find interpretation(problem,interpretation); | ||
61550 | PartialInterpretation.scopes(interpretation,scope); | ||
61551 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
61552 | Scope.maxNewElements(scope,0); | ||
61553 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
61554 | Type.name(type,"InformationLink class"); | ||
61555 | } | ||
61556 | |||
61557 | /** | ||
61558 | * An element may be an instance of type "InformationLink class". | ||
61559 | */ | ||
61560 | private pattern mayInstanceOfInformationLink_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
61561 | { | ||
61562 | find interpretation(problem,interpretation); | ||
61563 | PartialInterpretation.newElements(interpretation,element); | ||
61564 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
61565 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
61566 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
61567 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
61568 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
61569 | neg find scopeDisallowsNewInformationLink_class(problem, interpretation); | ||
61570 | neg find isPrimitive(element); | ||
61571 | } or { | ||
61572 | find interpretation(problem,interpretation); | ||
61573 | PartialInterpretation.openWorldElements(interpretation,element); | ||
61574 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
61575 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
61576 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
61577 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
61578 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
61579 | neg find scopeDisallowsNewInformationLink_class(problem, interpretation); | ||
61580 | neg find isPrimitive(element); | ||
61581 | } or | ||
61582 | { find mustInstanceOfInformationLink_class(problem,interpretation,element); } | ||
61583 | /** | ||
61584 | * An element must be an instance of type "FunctionalInterface class". | ||
61585 | */ | ||
61586 | private pattern mustInstanceOfFunctionalInterface_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
61587 | Type.name(type,"FunctionalInterface class"); | ||
61588 | find directInstanceOf(problem,interpretation,element,type); | ||
61589 | } | ||
61590 | private pattern scopeDisallowsNewFunctionalInterface_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
61591 | find interpretation(problem,interpretation); | ||
61592 | PartialInterpretation.scopes(interpretation,scope); | ||
61593 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
61594 | Scope.maxNewElements(scope,0); | ||
61595 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
61596 | Type.name(type,"FunctionalInterface class"); | ||
61597 | } | ||
61598 | |||
61599 | /** | ||
61600 | * An element may be an instance of type "FunctionalInterface class". | ||
61601 | */ | ||
61602 | private pattern mayInstanceOfFunctionalInterface_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
61603 | { | ||
61604 | find interpretation(problem,interpretation); | ||
61605 | PartialInterpretation.newElements(interpretation,element); | ||
61606 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
61607 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
61608 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
61609 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
61610 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
61611 | neg find scopeDisallowsNewFunctionalInterface_class(problem, interpretation); | ||
61612 | neg find isPrimitive(element); | ||
61613 | } or { | ||
61614 | find interpretation(problem,interpretation); | ||
61615 | PartialInterpretation.openWorldElements(interpretation,element); | ||
61616 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
61617 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
61618 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
61619 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
61620 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
61621 | neg find scopeDisallowsNewFunctionalInterface_class(problem, interpretation); | ||
61622 | neg find isPrimitive(element); | ||
61623 | } or | ||
61624 | { find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); } | ||
61625 | /** | ||
61626 | * An element must be an instance of type "FunctionalInput class". | ||
61627 | */ | ||
61628 | private pattern mustInstanceOfFunctionalInput_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
61629 | Type.name(type,"FunctionalInput class"); | ||
61630 | find directInstanceOf(problem,interpretation,element,type); | ||
61631 | } | ||
61632 | private pattern scopeDisallowsNewFunctionalInput_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
61633 | find interpretation(problem,interpretation); | ||
61634 | PartialInterpretation.scopes(interpretation,scope); | ||
61635 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
61636 | Scope.maxNewElements(scope,0); | ||
61637 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
61638 | Type.name(type,"FunctionalInput class"); | ||
61639 | } | ||
61640 | |||
61641 | /** | ||
61642 | * An element may be an instance of type "FunctionalInput class". | ||
61643 | */ | ||
61644 | private pattern mayInstanceOfFunctionalInput_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
61645 | { | ||
61646 | find interpretation(problem,interpretation); | ||
61647 | PartialInterpretation.newElements(interpretation,element); | ||
61648 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
61649 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
61650 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
61651 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
61652 | neg find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
61653 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
61654 | neg find scopeDisallowsNewFunctionalInput_class(problem, interpretation); | ||
61655 | neg find isPrimitive(element); | ||
61656 | } or { | ||
61657 | find interpretation(problem,interpretation); | ||
61658 | PartialInterpretation.openWorldElements(interpretation,element); | ||
61659 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
61660 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
61661 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
61662 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
61663 | neg find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
61664 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
61665 | neg find scopeDisallowsNewFunctionalInput_class(problem, interpretation); | ||
61666 | neg find isPrimitive(element); | ||
61667 | } or | ||
61668 | { find mustInstanceOfFunctionalInput_class(problem,interpretation,element); } | ||
61669 | /** | ||
61670 | * An element must be an instance of type "FunctionalOutput class". | ||
61671 | */ | ||
61672 | private pattern mustInstanceOfFunctionalOutput_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
61673 | Type.name(type,"FunctionalOutput class"); | ||
61674 | find directInstanceOf(problem,interpretation,element,type); | ||
61675 | } | ||
61676 | private pattern scopeDisallowsNewFunctionalOutput_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
61677 | find interpretation(problem,interpretation); | ||
61678 | PartialInterpretation.scopes(interpretation,scope); | ||
61679 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
61680 | Scope.maxNewElements(scope,0); | ||
61681 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
61682 | Type.name(type,"FunctionalOutput class"); | ||
61683 | } | ||
61684 | |||
61685 | /** | ||
61686 | * An element may be an instance of type "FunctionalOutput class". | ||
61687 | */ | ||
61688 | private pattern mayInstanceOfFunctionalOutput_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
61689 | { | ||
61690 | find interpretation(problem,interpretation); | ||
61691 | PartialInterpretation.newElements(interpretation,element); | ||
61692 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
61693 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
61694 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
61695 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
61696 | neg find mustInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
61697 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
61698 | neg find scopeDisallowsNewFunctionalOutput_class(problem, interpretation); | ||
61699 | neg find isPrimitive(element); | ||
61700 | } or { | ||
61701 | find interpretation(problem,interpretation); | ||
61702 | PartialInterpretation.openWorldElements(interpretation,element); | ||
61703 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
61704 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
61705 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
61706 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
61707 | neg find mustInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
61708 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
61709 | neg find scopeDisallowsNewFunctionalOutput_class(problem, interpretation); | ||
61710 | neg find isPrimitive(element); | ||
61711 | } or | ||
61712 | { find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); } | ||
61713 | /** | ||
61714 | * An element must be an instance of type "FunctionalData class". | ||
61715 | */ | ||
61716 | private pattern mustInstanceOfFunctionalData_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
61717 | Type.name(type,"FunctionalData class"); | ||
61718 | find directInstanceOf(problem,interpretation,element,type); | ||
61719 | } | ||
61720 | private pattern scopeDisallowsNewFunctionalData_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
61721 | find interpretation(problem,interpretation); | ||
61722 | PartialInterpretation.scopes(interpretation,scope); | ||
61723 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
61724 | Scope.maxNewElements(scope,0); | ||
61725 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
61726 | Type.name(type,"FunctionalData class"); | ||
61727 | } | ||
61728 | |||
61729 | /** | ||
61730 | * An element may be an instance of type "FunctionalData class". | ||
61731 | */ | ||
61732 | private pattern mayInstanceOfFunctionalData_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
61733 | { | ||
61734 | find interpretation(problem,interpretation); | ||
61735 | PartialInterpretation.newElements(interpretation,element); | ||
61736 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
61737 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
61738 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
61739 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
61740 | neg find mustInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
61741 | neg find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
61742 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
61743 | neg find scopeDisallowsNewFunctionalData_class(problem, interpretation); | ||
61744 | neg find isPrimitive(element); | ||
61745 | } or { | ||
61746 | find interpretation(problem,interpretation); | ||
61747 | PartialInterpretation.openWorldElements(interpretation,element); | ||
61748 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
61749 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
61750 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
61751 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
61752 | neg find mustInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
61753 | neg find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
61754 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
61755 | neg find scopeDisallowsNewFunctionalData_class(problem, interpretation); | ||
61756 | neg find isPrimitive(element); | ||
61757 | } or | ||
61758 | { find mustInstanceOfFunctionalData_class(problem,interpretation,element); } | ||
61759 | /** | ||
61760 | * An element must be an instance of type "FunctionType enum". | ||
61761 | */ | ||
61762 | private pattern mustInstanceOfFunctionType_enum(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
61763 | Type.name(type,"FunctionType enum"); | ||
61764 | find directInstanceOf(problem,interpretation,element,type); | ||
61765 | } | ||
61766 | private pattern scopeDisallowsNewFunctionType_enum(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
61767 | find interpretation(problem,interpretation); | ||
61768 | PartialInterpretation.scopes(interpretation,scope); | ||
61769 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
61770 | Scope.maxNewElements(scope,0); | ||
61771 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
61772 | Type.name(type,"FunctionType enum"); | ||
61773 | } | ||
61774 | |||
61775 | /** | ||
61776 | * An element may be an instance of type "FunctionType enum". | ||
61777 | */ | ||
61778 | private pattern mayInstanceOfFunctionType_enum(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
61779 | { find mustInstanceOfFunctionType_enum(problem,interpretation,element); } | ||
61780 | |||
61781 | ////////// | ||
61782 | // 1.2 Relation Declaration Indexers | ||
61783 | ////////// | ||
61784 | /** | ||
61785 | * Matcher for detecting tuples t where []interface reference FunctionalElement(source,target) | ||
61786 | */ | ||
61787 | private pattern mustInRelationinterface_reference_FunctionalElement( | ||
61788 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
61789 | source: DefinedElement, target:DefinedElement) | ||
61790 | { | ||
61791 | find interpretation(problem,interpretation); | ||
61792 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
61793 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"interface reference FunctionalElement"); | ||
61794 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
61795 | BinaryElementRelationLink.param1(link,source); | ||
61796 | BinaryElementRelationLink.param2(link,target); | ||
61797 | } | ||
61798 | /** | ||
61799 | * Matcher for detecting tuples t where <>interface reference FunctionalElement(source,target) | ||
61800 | */ | ||
61801 | private pattern mayInRelationinterface_reference_FunctionalElement( | ||
61802 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
61803 | source: DefinedElement, target:DefinedElement) | ||
61804 | { | ||
61805 | find interpretation(problem,interpretation); | ||
61806 | // The two endpoint of the link have to exist | ||
61807 | find mayExist(problem, interpretation, source); | ||
61808 | find mayExist(problem, interpretation, target); | ||
61809 | // Type consistency | ||
61810 | find mayInstanceOfFunctionalElement_class(problem,interpretation,source); | ||
61811 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,target); | ||
61812 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
61813 | // the upper bound of the multiplicity should be considered. | ||
61814 | numberOfExistingReferences == count find mustInRelationinterface_reference_FunctionalElement(problem,interpretation,source,_); | ||
61815 | check(numberOfExistingReferences < 1); | ||
61816 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
61817 | // the upper bound of the opposite reference multiplicity should be considered. | ||
61818 | numberOfExistingOppositeReferences == count find mustInRelationelement_reference_FunctionalInterface(problem,interpretation,target,_); | ||
61819 | check(numberOfExistingOppositeReferences < 1); | ||
61820 | // The reference is containment, then a new reference cannot be create if: | ||
61821 | // 1. Multiple parents | ||
61822 | neg find mustContains4(problem,interpretation,_,target); | ||
61823 | // 2. Circle in the containment hierarchy | ||
61824 | neg find mustTransitiveContains(source,target); | ||
61825 | } or { | ||
61826 | find mustInRelationinterface_reference_FunctionalElement(problem,interpretation,source,target); | ||
61827 | } | ||
61828 | /** | ||
61829 | * Matcher for detecting tuples t where []model reference FunctionalElement(source,target) | ||
61830 | */ | ||
61831 | private pattern mustInRelationmodel_reference_FunctionalElement( | ||
61832 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
61833 | source: DefinedElement, target:DefinedElement) | ||
61834 | { | ||
61835 | find interpretation(problem,interpretation); | ||
61836 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
61837 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"model reference FunctionalElement"); | ||
61838 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
61839 | BinaryElementRelationLink.param1(link,source); | ||
61840 | BinaryElementRelationLink.param2(link,target); | ||
61841 | } | ||
61842 | /** | ||
61843 | * Matcher for detecting tuples t where <>model reference FunctionalElement(source,target) | ||
61844 | */ | ||
61845 | private pattern mayInRelationmodel_reference_FunctionalElement( | ||
61846 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
61847 | source: DefinedElement, target:DefinedElement) | ||
61848 | { | ||
61849 | find interpretation(problem,interpretation); | ||
61850 | // The two endpoint of the link have to exist | ||
61851 | find mayExist(problem, interpretation, source); | ||
61852 | find mayExist(problem, interpretation, target); | ||
61853 | // Type consistency | ||
61854 | find mayInstanceOfFunctionalElement_class(problem,interpretation,source); | ||
61855 | find mayInstanceOfFunctionalArchitectureModel_class(problem,interpretation,target); | ||
61856 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
61857 | // the upper bound of the multiplicity should be considered. | ||
61858 | numberOfExistingReferences == count find mustInRelationmodel_reference_FunctionalElement(problem,interpretation,source,_); | ||
61859 | check(numberOfExistingReferences < 1); | ||
61860 | } or { | ||
61861 | find mustInRelationmodel_reference_FunctionalElement(problem,interpretation,source,target); | ||
61862 | } | ||
61863 | /** | ||
61864 | * Matcher for detecting tuples t where []parent reference FunctionalElement(source,target) | ||
61865 | */ | ||
61866 | private pattern mustInRelationparent_reference_FunctionalElement( | ||
61867 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
61868 | source: DefinedElement, target:DefinedElement) | ||
61869 | { | ||
61870 | find interpretation(problem,interpretation); | ||
61871 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
61872 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"parent reference FunctionalElement"); | ||
61873 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
61874 | BinaryElementRelationLink.param1(link,source); | ||
61875 | BinaryElementRelationLink.param2(link,target); | ||
61876 | } | ||
61877 | /** | ||
61878 | * Matcher for detecting tuples t where <>parent reference FunctionalElement(source,target) | ||
61879 | */ | ||
61880 | private pattern mayInRelationparent_reference_FunctionalElement( | ||
61881 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
61882 | source: DefinedElement, target:DefinedElement) | ||
61883 | { | ||
61884 | find interpretation(problem,interpretation); | ||
61885 | // The two endpoint of the link have to exist | ||
61886 | find mayExist(problem, interpretation, source); | ||
61887 | find mayExist(problem, interpretation, target); | ||
61888 | // Type consistency | ||
61889 | find mayInstanceOfFunctionalElement_class(problem,interpretation,source); | ||
61890 | find mayInstanceOfFunction_class(problem,interpretation,target); | ||
61891 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
61892 | // the upper bound of the multiplicity should be considered. | ||
61893 | numberOfExistingReferences == count find mustInRelationparent_reference_FunctionalElement(problem,interpretation,source,_); | ||
61894 | check(numberOfExistingReferences < 1); | ||
61895 | // The eOpposite of the reference is containment, then a referene cannot be created if | ||
61896 | // 1. Multiple parents | ||
61897 | neg find mustContains4(problem,interpretation,source,_); | ||
61898 | // 2. Circle in the containment hierarchy | ||
61899 | neg find mustTransitiveContains(source,target); | ||
61900 | } or { | ||
61901 | find mustInRelationparent_reference_FunctionalElement(problem,interpretation,source,target); | ||
61902 | } | ||
61903 | /** | ||
61904 | * Matcher for detecting tuples t where []rootElements reference FunctionalArchitectureModel(source,target) | ||
61905 | */ | ||
61906 | private pattern mustInRelationrootElements_reference_FunctionalArchitectureModel( | ||
61907 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
61908 | source: DefinedElement, target:DefinedElement) | ||
61909 | { | ||
61910 | find interpretation(problem,interpretation); | ||
61911 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
61912 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"rootElements reference FunctionalArchitectureModel"); | ||
61913 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
61914 | BinaryElementRelationLink.param1(link,source); | ||
61915 | BinaryElementRelationLink.param2(link,target); | ||
61916 | } | ||
61917 | /** | ||
61918 | * Matcher for detecting tuples t where <>rootElements reference FunctionalArchitectureModel(source,target) | ||
61919 | */ | ||
61920 | private pattern mayInRelationrootElements_reference_FunctionalArchitectureModel( | ||
61921 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
61922 | source: DefinedElement, target:DefinedElement) | ||
61923 | { | ||
61924 | find interpretation(problem,interpretation); | ||
61925 | // The two endpoint of the link have to exist | ||
61926 | find mayExist(problem, interpretation, source); | ||
61927 | find mayExist(problem, interpretation, target); | ||
61928 | // Type consistency | ||
61929 | find mayInstanceOfFunctionalArchitectureModel_class(problem,interpretation,source); | ||
61930 | find mayInstanceOfFunctionalElement_class(problem,interpretation,target); | ||
61931 | // The reference is containment, then a new reference cannot be create if: | ||
61932 | // 1. Multiple parents | ||
61933 | neg find mustContains4(problem,interpretation,_,target); | ||
61934 | // 2. Circle in the containment hierarchy | ||
61935 | neg find mustTransitiveContains(source,target); | ||
61936 | } or { | ||
61937 | find mustInRelationrootElements_reference_FunctionalArchitectureModel(problem,interpretation,source,target); | ||
61938 | } | ||
61939 | /** | ||
61940 | * Matcher for detecting tuples t where []subElements reference Function(source,target) | ||
61941 | */ | ||
61942 | private pattern mustInRelationsubElements_reference_Function( | ||
61943 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
61944 | source: DefinedElement, target:DefinedElement) | ||
61945 | { | ||
61946 | find interpretation(problem,interpretation); | ||
61947 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
61948 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"subElements reference Function"); | ||
61949 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
61950 | BinaryElementRelationLink.param1(link,source); | ||
61951 | BinaryElementRelationLink.param2(link,target); | ||
61952 | } | ||
61953 | /** | ||
61954 | * Matcher for detecting tuples t where <>subElements reference Function(source,target) | ||
61955 | */ | ||
61956 | private pattern mayInRelationsubElements_reference_Function( | ||
61957 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
61958 | source: DefinedElement, target:DefinedElement) | ||
61959 | { | ||
61960 | find interpretation(problem,interpretation); | ||
61961 | // The two endpoint of the link have to exist | ||
61962 | find mayExist(problem, interpretation, source); | ||
61963 | find mayExist(problem, interpretation, target); | ||
61964 | // Type consistency | ||
61965 | find mayInstanceOfFunction_class(problem,interpretation,source); | ||
61966 | find mayInstanceOfFunctionalElement_class(problem,interpretation,target); | ||
61967 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
61968 | // the upper bound of the opposite reference multiplicity should be considered. | ||
61969 | numberOfExistingOppositeReferences == count find mustInRelationparent_reference_FunctionalElement(problem,interpretation,target,_); | ||
61970 | check(numberOfExistingOppositeReferences < 1); | ||
61971 | // The reference is containment, then a new reference cannot be create if: | ||
61972 | // 1. Multiple parents | ||
61973 | neg find mustContains4(problem,interpretation,_,target); | ||
61974 | // 2. Circle in the containment hierarchy | ||
61975 | neg find mustTransitiveContains(source,target); | ||
61976 | } or { | ||
61977 | find mustInRelationsubElements_reference_Function(problem,interpretation,source,target); | ||
61978 | } | ||
61979 | /** | ||
61980 | * Matcher for detecting tuples t where []data reference FAMTerminator(source,target) | ||
61981 | */ | ||
61982 | private pattern mustInRelationdata_reference_FAMTerminator( | ||
61983 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
61984 | source: DefinedElement, target:DefinedElement) | ||
61985 | { | ||
61986 | find interpretation(problem,interpretation); | ||
61987 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
61988 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"data reference FAMTerminator"); | ||
61989 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
61990 | BinaryElementRelationLink.param1(link,source); | ||
61991 | BinaryElementRelationLink.param2(link,target); | ||
61992 | } | ||
61993 | /** | ||
61994 | * Matcher for detecting tuples t where <>data reference FAMTerminator(source,target) | ||
61995 | */ | ||
61996 | private pattern mayInRelationdata_reference_FAMTerminator( | ||
61997 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
61998 | source: DefinedElement, target:DefinedElement) | ||
61999 | { | ||
62000 | find interpretation(problem,interpretation); | ||
62001 | // The two endpoint of the link have to exist | ||
62002 | find mayExist(problem, interpretation, source); | ||
62003 | find mayExist(problem, interpretation, target); | ||
62004 | // Type consistency | ||
62005 | find mayInstanceOfFAMTerminator_class(problem,interpretation,source); | ||
62006 | find mayInstanceOfFunctionalData_class(problem,interpretation,target); | ||
62007 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
62008 | // the upper bound of the multiplicity should be considered. | ||
62009 | numberOfExistingReferences == count find mustInRelationdata_reference_FAMTerminator(problem,interpretation,source,_); | ||
62010 | check(numberOfExistingReferences < 1); | ||
62011 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
62012 | // the upper bound of the opposite reference multiplicity should be considered. | ||
62013 | numberOfExistingOppositeReferences == count find mustInRelationterminator_reference_FunctionalData(problem,interpretation,target,_); | ||
62014 | check(numberOfExistingOppositeReferences < 1); | ||
62015 | // The eOpposite of the reference is containment, then a referene cannot be created if | ||
62016 | // 1. Multiple parents | ||
62017 | neg find mustContains4(problem,interpretation,source,_); | ||
62018 | // 2. Circle in the containment hierarchy | ||
62019 | neg find mustTransitiveContains(source,target); | ||
62020 | } or { | ||
62021 | find mustInRelationdata_reference_FAMTerminator(problem,interpretation,source,target); | ||
62022 | } | ||
62023 | /** | ||
62024 | * Matcher for detecting tuples t where []from reference InformationLink(source,target) | ||
62025 | */ | ||
62026 | private pattern mustInRelationfrom_reference_InformationLink( | ||
62027 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
62028 | source: DefinedElement, target:DefinedElement) | ||
62029 | { | ||
62030 | find interpretation(problem,interpretation); | ||
62031 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
62032 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"from reference InformationLink"); | ||
62033 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
62034 | BinaryElementRelationLink.param1(link,source); | ||
62035 | BinaryElementRelationLink.param2(link,target); | ||
62036 | } | ||
62037 | /** | ||
62038 | * Matcher for detecting tuples t where <>from reference InformationLink(source,target) | ||
62039 | */ | ||
62040 | private pattern mayInRelationfrom_reference_InformationLink( | ||
62041 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
62042 | source: DefinedElement, target:DefinedElement) | ||
62043 | { | ||
62044 | find interpretation(problem,interpretation); | ||
62045 | // The two endpoint of the link have to exist | ||
62046 | find mayExist(problem, interpretation, source); | ||
62047 | find mayExist(problem, interpretation, target); | ||
62048 | // Type consistency | ||
62049 | find mayInstanceOfInformationLink_class(problem,interpretation,source); | ||
62050 | find mayInstanceOfFunctionalOutput_class(problem,interpretation,target); | ||
62051 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
62052 | // the upper bound of the multiplicity should be considered. | ||
62053 | numberOfExistingReferences == count find mustInRelationfrom_reference_InformationLink(problem,interpretation,source,_); | ||
62054 | check(numberOfExistingReferences < 1); | ||
62055 | // The eOpposite of the reference is containment, then a referene cannot be created if | ||
62056 | // 1. Multiple parents | ||
62057 | neg find mustContains4(problem,interpretation,source,_); | ||
62058 | // 2. Circle in the containment hierarchy | ||
62059 | neg find mustTransitiveContains(source,target); | ||
62060 | } or { | ||
62061 | find mustInRelationfrom_reference_InformationLink(problem,interpretation,source,target); | ||
62062 | } | ||
62063 | /** | ||
62064 | * Matcher for detecting tuples t where []to reference InformationLink(source,target) | ||
62065 | */ | ||
62066 | private pattern mustInRelationto_reference_InformationLink( | ||
62067 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
62068 | source: DefinedElement, target:DefinedElement) | ||
62069 | { | ||
62070 | find interpretation(problem,interpretation); | ||
62071 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
62072 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"to reference InformationLink"); | ||
62073 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
62074 | BinaryElementRelationLink.param1(link,source); | ||
62075 | BinaryElementRelationLink.param2(link,target); | ||
62076 | } | ||
62077 | /** | ||
62078 | * Matcher for detecting tuples t where <>to reference InformationLink(source,target) | ||
62079 | */ | ||
62080 | private pattern mayInRelationto_reference_InformationLink( | ||
62081 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
62082 | source: DefinedElement, target:DefinedElement) | ||
62083 | { | ||
62084 | find interpretation(problem,interpretation); | ||
62085 | // The two endpoint of the link have to exist | ||
62086 | find mayExist(problem, interpretation, source); | ||
62087 | find mayExist(problem, interpretation, target); | ||
62088 | // Type consistency | ||
62089 | find mayInstanceOfInformationLink_class(problem,interpretation,source); | ||
62090 | find mayInstanceOfFunctionalInput_class(problem,interpretation,target); | ||
62091 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
62092 | // the upper bound of the multiplicity should be considered. | ||
62093 | numberOfExistingReferences == count find mustInRelationto_reference_InformationLink(problem,interpretation,source,_); | ||
62094 | check(numberOfExistingReferences < 1); | ||
62095 | } or { | ||
62096 | find mustInRelationto_reference_InformationLink(problem,interpretation,source,target); | ||
62097 | } | ||
62098 | /** | ||
62099 | * Matcher for detecting tuples t where []data reference FunctionalInterface(source,target) | ||
62100 | */ | ||
62101 | private pattern mustInRelationdata_reference_FunctionalInterface( | ||
62102 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
62103 | source: DefinedElement, target:DefinedElement) | ||
62104 | { | ||
62105 | find interpretation(problem,interpretation); | ||
62106 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
62107 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"data reference FunctionalInterface"); | ||
62108 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
62109 | BinaryElementRelationLink.param1(link,source); | ||
62110 | BinaryElementRelationLink.param2(link,target); | ||
62111 | } | ||
62112 | /** | ||
62113 | * Matcher for detecting tuples t where <>data reference FunctionalInterface(source,target) | ||
62114 | */ | ||
62115 | private pattern mayInRelationdata_reference_FunctionalInterface( | ||
62116 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
62117 | source: DefinedElement, target:DefinedElement) | ||
62118 | { | ||
62119 | find interpretation(problem,interpretation); | ||
62120 | // The two endpoint of the link have to exist | ||
62121 | find mayExist(problem, interpretation, source); | ||
62122 | find mayExist(problem, interpretation, target); | ||
62123 | // Type consistency | ||
62124 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,source); | ||
62125 | find mayInstanceOfFunctionalData_class(problem,interpretation,target); | ||
62126 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
62127 | // the upper bound of the opposite reference multiplicity should be considered. | ||
62128 | numberOfExistingOppositeReferences == count find mustInRelationinterface_reference_FunctionalData(problem,interpretation,target,_); | ||
62129 | check(numberOfExistingOppositeReferences < 1); | ||
62130 | // The reference is containment, then a new reference cannot be create if: | ||
62131 | // 1. Multiple parents | ||
62132 | neg find mustContains4(problem,interpretation,_,target); | ||
62133 | // 2. Circle in the containment hierarchy | ||
62134 | neg find mustTransitiveContains(source,target); | ||
62135 | } or { | ||
62136 | find mustInRelationdata_reference_FunctionalInterface(problem,interpretation,source,target); | ||
62137 | } | ||
62138 | /** | ||
62139 | * Matcher for detecting tuples t where []element reference FunctionalInterface(source,target) | ||
62140 | */ | ||
62141 | private pattern mustInRelationelement_reference_FunctionalInterface( | ||
62142 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
62143 | source: DefinedElement, target:DefinedElement) | ||
62144 | { | ||
62145 | find interpretation(problem,interpretation); | ||
62146 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
62147 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"element reference FunctionalInterface"); | ||
62148 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
62149 | BinaryElementRelationLink.param1(link,source); | ||
62150 | BinaryElementRelationLink.param2(link,target); | ||
62151 | } | ||
62152 | /** | ||
62153 | * Matcher for detecting tuples t where <>element reference FunctionalInterface(source,target) | ||
62154 | */ | ||
62155 | private pattern mayInRelationelement_reference_FunctionalInterface( | ||
62156 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
62157 | source: DefinedElement, target:DefinedElement) | ||
62158 | { | ||
62159 | find interpretation(problem,interpretation); | ||
62160 | // The two endpoint of the link have to exist | ||
62161 | find mayExist(problem, interpretation, source); | ||
62162 | find mayExist(problem, interpretation, target); | ||
62163 | // Type consistency | ||
62164 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,source); | ||
62165 | find mayInstanceOfFunctionalElement_class(problem,interpretation,target); | ||
62166 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
62167 | // the upper bound of the multiplicity should be considered. | ||
62168 | numberOfExistingReferences == count find mustInRelationelement_reference_FunctionalInterface(problem,interpretation,source,_); | ||
62169 | check(numberOfExistingReferences < 1); | ||
62170 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
62171 | // the upper bound of the opposite reference multiplicity should be considered. | ||
62172 | numberOfExistingOppositeReferences == count find mustInRelationinterface_reference_FunctionalElement(problem,interpretation,target,_); | ||
62173 | check(numberOfExistingOppositeReferences < 1); | ||
62174 | // The eOpposite of the reference is containment, then a referene cannot be created if | ||
62175 | // 1. Multiple parents | ||
62176 | neg find mustContains4(problem,interpretation,source,_); | ||
62177 | // 2. Circle in the containment hierarchy | ||
62178 | neg find mustTransitiveContains(source,target); | ||
62179 | } or { | ||
62180 | find mustInRelationelement_reference_FunctionalInterface(problem,interpretation,source,target); | ||
62181 | } | ||
62182 | /** | ||
62183 | * Matcher for detecting tuples t where []IncomingLinks reference FunctionalInput(source,target) | ||
62184 | */ | ||
62185 | private pattern mustInRelationIncomingLinks_reference_FunctionalInput( | ||
62186 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
62187 | source: DefinedElement, target:DefinedElement) | ||
62188 | { | ||
62189 | find interpretation(problem,interpretation); | ||
62190 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
62191 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"IncomingLinks reference FunctionalInput"); | ||
62192 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
62193 | BinaryElementRelationLink.param1(link,source); | ||
62194 | BinaryElementRelationLink.param2(link,target); | ||
62195 | } | ||
62196 | /** | ||
62197 | * Matcher for detecting tuples t where <>IncomingLinks reference FunctionalInput(source,target) | ||
62198 | */ | ||
62199 | private pattern mayInRelationIncomingLinks_reference_FunctionalInput( | ||
62200 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
62201 | source: DefinedElement, target:DefinedElement) | ||
62202 | { | ||
62203 | find interpretation(problem,interpretation); | ||
62204 | // The two endpoint of the link have to exist | ||
62205 | find mayExist(problem, interpretation, source); | ||
62206 | find mayExist(problem, interpretation, target); | ||
62207 | // Type consistency | ||
62208 | find mayInstanceOfFunctionalInput_class(problem,interpretation,source); | ||
62209 | find mayInstanceOfInformationLink_class(problem,interpretation,target); | ||
62210 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
62211 | // the upper bound of the opposite reference multiplicity should be considered. | ||
62212 | numberOfExistingOppositeReferences == count find mustInRelationto_reference_InformationLink(problem,interpretation,target,_); | ||
62213 | check(numberOfExistingOppositeReferences < 1); | ||
62214 | } or { | ||
62215 | find mustInRelationIncomingLinks_reference_FunctionalInput(problem,interpretation,source,target); | ||
62216 | } | ||
62217 | /** | ||
62218 | * Matcher for detecting tuples t where []outgoingLinks reference FunctionalOutput(source,target) | ||
62219 | */ | ||
62220 | private pattern mustInRelationoutgoingLinks_reference_FunctionalOutput( | ||
62221 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
62222 | source: DefinedElement, target:DefinedElement) | ||
62223 | { | ||
62224 | find interpretation(problem,interpretation); | ||
62225 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
62226 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"outgoingLinks reference FunctionalOutput"); | ||
62227 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
62228 | BinaryElementRelationLink.param1(link,source); | ||
62229 | BinaryElementRelationLink.param2(link,target); | ||
62230 | } | ||
62231 | /** | ||
62232 | * Matcher for detecting tuples t where <>outgoingLinks reference FunctionalOutput(source,target) | ||
62233 | */ | ||
62234 | private pattern mayInRelationoutgoingLinks_reference_FunctionalOutput( | ||
62235 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
62236 | source: DefinedElement, target:DefinedElement) | ||
62237 | { | ||
62238 | find interpretation(problem,interpretation); | ||
62239 | // The two endpoint of the link have to exist | ||
62240 | find mayExist(problem, interpretation, source); | ||
62241 | find mayExist(problem, interpretation, target); | ||
62242 | // Type consistency | ||
62243 | find mayInstanceOfFunctionalOutput_class(problem,interpretation,source); | ||
62244 | find mayInstanceOfInformationLink_class(problem,interpretation,target); | ||
62245 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
62246 | // the upper bound of the opposite reference multiplicity should be considered. | ||
62247 | numberOfExistingOppositeReferences == count find mustInRelationfrom_reference_InformationLink(problem,interpretation,target,_); | ||
62248 | check(numberOfExistingOppositeReferences < 1); | ||
62249 | // The reference is containment, then a new reference cannot be create if: | ||
62250 | // 1. Multiple parents | ||
62251 | neg find mustContains4(problem,interpretation,_,target); | ||
62252 | // 2. Circle in the containment hierarchy | ||
62253 | neg find mustTransitiveContains(source,target); | ||
62254 | } or { | ||
62255 | find mustInRelationoutgoingLinks_reference_FunctionalOutput(problem,interpretation,source,target); | ||
62256 | } | ||
62257 | /** | ||
62258 | * Matcher for detecting tuples t where []terminator reference FunctionalData(source,target) | ||
62259 | */ | ||
62260 | private pattern mustInRelationterminator_reference_FunctionalData( | ||
62261 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
62262 | source: DefinedElement, target:DefinedElement) | ||
62263 | { | ||
62264 | find interpretation(problem,interpretation); | ||
62265 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
62266 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"terminator reference FunctionalData"); | ||
62267 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
62268 | BinaryElementRelationLink.param1(link,source); | ||
62269 | BinaryElementRelationLink.param2(link,target); | ||
62270 | } | ||
62271 | /** | ||
62272 | * Matcher for detecting tuples t where <>terminator reference FunctionalData(source,target) | ||
62273 | */ | ||
62274 | private pattern mayInRelationterminator_reference_FunctionalData( | ||
62275 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
62276 | source: DefinedElement, target:DefinedElement) | ||
62277 | { | ||
62278 | find interpretation(problem,interpretation); | ||
62279 | // The two endpoint of the link have to exist | ||
62280 | find mayExist(problem, interpretation, source); | ||
62281 | find mayExist(problem, interpretation, target); | ||
62282 | // Type consistency | ||
62283 | find mayInstanceOfFunctionalData_class(problem,interpretation,source); | ||
62284 | find mayInstanceOfFAMTerminator_class(problem,interpretation,target); | ||
62285 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
62286 | // the upper bound of the multiplicity should be considered. | ||
62287 | numberOfExistingReferences == count find mustInRelationterminator_reference_FunctionalData(problem,interpretation,source,_); | ||
62288 | check(numberOfExistingReferences < 1); | ||
62289 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
62290 | // the upper bound of the opposite reference multiplicity should be considered. | ||
62291 | numberOfExistingOppositeReferences == count find mustInRelationdata_reference_FAMTerminator(problem,interpretation,target,_); | ||
62292 | check(numberOfExistingOppositeReferences < 1); | ||
62293 | // The reference is containment, then a new reference cannot be create if: | ||
62294 | // 1. Multiple parents | ||
62295 | neg find mustContains4(problem,interpretation,_,target); | ||
62296 | // 2. Circle in the containment hierarchy | ||
62297 | neg find mustTransitiveContains(source,target); | ||
62298 | } or { | ||
62299 | find mustInRelationterminator_reference_FunctionalData(problem,interpretation,source,target); | ||
62300 | } | ||
62301 | /** | ||
62302 | * Matcher for detecting tuples t where []interface reference FunctionalData(source,target) | ||
62303 | */ | ||
62304 | private pattern mustInRelationinterface_reference_FunctionalData( | ||
62305 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
62306 | source: DefinedElement, target:DefinedElement) | ||
62307 | { | ||
62308 | find interpretation(problem,interpretation); | ||
62309 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
62310 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"interface reference FunctionalData"); | ||
62311 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
62312 | BinaryElementRelationLink.param1(link,source); | ||
62313 | BinaryElementRelationLink.param2(link,target); | ||
62314 | } | ||
62315 | /** | ||
62316 | * Matcher for detecting tuples t where <>interface reference FunctionalData(source,target) | ||
62317 | */ | ||
62318 | private pattern mayInRelationinterface_reference_FunctionalData( | ||
62319 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
62320 | source: DefinedElement, target:DefinedElement) | ||
62321 | { | ||
62322 | find interpretation(problem,interpretation); | ||
62323 | // The two endpoint of the link have to exist | ||
62324 | find mayExist(problem, interpretation, source); | ||
62325 | find mayExist(problem, interpretation, target); | ||
62326 | // Type consistency | ||
62327 | find mayInstanceOfFunctionalData_class(problem,interpretation,source); | ||
62328 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,target); | ||
62329 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
62330 | // the upper bound of the multiplicity should be considered. | ||
62331 | numberOfExistingReferences == count find mustInRelationinterface_reference_FunctionalData(problem,interpretation,source,_); | ||
62332 | check(numberOfExistingReferences < 1); | ||
62333 | // The eOpposite of the reference is containment, then a referene cannot be created if | ||
62334 | // 1. Multiple parents | ||
62335 | neg find mustContains4(problem,interpretation,source,_); | ||
62336 | // 2. Circle in the containment hierarchy | ||
62337 | neg find mustTransitiveContains(source,target); | ||
62338 | } or { | ||
62339 | find mustInRelationinterface_reference_FunctionalData(problem,interpretation,source,target); | ||
62340 | } | ||
62341 | /** | ||
62342 | * Matcher for detecting tuples t where []type attribute Function(source,target) | ||
62343 | */ | ||
62344 | private pattern mustInRelationtype_attribute_Function( | ||
62345 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
62346 | source: DefinedElement, target:DefinedElement) | ||
62347 | { | ||
62348 | find interpretation(problem,interpretation); | ||
62349 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
62350 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"type attribute Function"); | ||
62351 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
62352 | BinaryElementRelationLink.param1(link,source); | ||
62353 | BinaryElementRelationLink.param2(link,target); | ||
62354 | } | ||
62355 | /** | ||
62356 | * Matcher for detecting tuples t where <>type attribute Function(source,target) | ||
62357 | */ | ||
62358 | private pattern mayInRelationtype_attribute_Function( | ||
62359 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
62360 | source: DefinedElement, target:DefinedElement) | ||
62361 | { | ||
62362 | find interpretation(problem,interpretation); | ||
62363 | // The two endpoint of the link have to exist | ||
62364 | find mayExist(problem, interpretation, source); | ||
62365 | find mayExist(problem, interpretation, target); | ||
62366 | // Type consistency | ||
62367 | find mayInstanceOfFunction_class(problem,interpretation,source); | ||
62368 | find mayInstanceOfFunctionType_enum(problem,interpretation,target); | ||
62369 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
62370 | // the upper bound of the multiplicity should be considered. | ||
62371 | numberOfExistingReferences == count find mustInRelationtype_attribute_Function(problem,interpretation,source,_); | ||
62372 | check(numberOfExistingReferences < 1); | ||
62373 | } or { | ||
62374 | find mustInRelationtype_attribute_Function(problem,interpretation,source,target); | ||
62375 | } | ||
62376 | |||
62377 | ////////// | ||
62378 | // 1.3 Relation Definition Indexers | ||
62379 | ////////// | ||
62380 | |||
62381 | ////////// | ||
62382 | // 1.4 Containment Indexer | ||
62383 | ////////// | ||
62384 | private pattern mustContains2(source: DefinedElement, target: DefinedElement) { | ||
62385 | find mustContains4(_,_,source,target); | ||
62386 | } | ||
62387 | |||
62388 | private pattern mustContains4(problem:LogicProblem, interpretation:PartialInterpretation, | ||
62389 | source: DefinedElement, target: DefinedElement) | ||
62390 | { find mustInRelationinterface_reference_FunctionalElement(problem,interpretation,source,target); }or | ||
62391 | |||
62392 | { find mustInRelationrootElements_reference_FunctionalArchitectureModel(problem,interpretation,source,target); }or | ||
62393 | |||
62394 | { find mustInRelationsubElements_reference_Function(problem,interpretation,source,target); }or | ||
62395 | |||
62396 | { find mustInRelationdata_reference_FunctionalInterface(problem,interpretation,source,target); }or | ||
62397 | |||
62398 | { find mustInRelationoutgoingLinks_reference_FunctionalOutput(problem,interpretation,source,target); }or | ||
62399 | |||
62400 | { find mustInRelationterminator_reference_FunctionalData(problem,interpretation,source,target); } | ||
62401 | |||
62402 | private pattern mustTransitiveContains(source,target) { | ||
62403 | find mustContains2+(source,target); | ||
62404 | } | ||
62405 | |||
62406 | ////////// | ||
62407 | // 2. Invalidation Indexers | ||
62408 | ////////// | ||
62409 | // 2.1 Invalidated by WF Queries | ||
62410 | ////////// | ||
62411 | |||
62412 | ////////// | ||
62413 | // 3. Unfinishedness Indexers | ||
62414 | ////////// | ||
62415 | // 3.1 Unfinishedness Measured by Multiplicity | ||
62416 | ////////// | ||
62417 | pattern unfinishedLowerMultiplicity_model_reference_FunctionalElement(problem:LogicProblem, interpretation:PartialInterpretation, relationIterpretation:PartialRelationInterpretation, object:DefinedElement,missingMultiplicity) { | ||
62418 | find interpretation(problem,interpretation); | ||
62419 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
62420 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"model reference FunctionalElement"); | ||
62421 | find mustInstanceOfFunctionalElement_class(problem,interpretation,object); | ||
62422 | numberOfExistingReferences == count find mustInRelationmodel_reference_FunctionalElement(problem,interpretation,object,_); | ||
62423 | check(numberOfExistingReferences < 1); | ||
62424 | missingMultiplicity == eval(1-numberOfExistingReferences); | ||
62425 | } | ||
62426 | pattern unfinishedLowerMultiplicity_to_reference_InformationLink(problem:LogicProblem, interpretation:PartialInterpretation, relationIterpretation:PartialRelationInterpretation, object:DefinedElement,missingMultiplicity) { | ||
62427 | find interpretation(problem,interpretation); | ||
62428 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
62429 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"to reference InformationLink"); | ||
62430 | find mustInstanceOfInformationLink_class(problem,interpretation,object); | ||
62431 | numberOfExistingReferences == count find mustInRelationto_reference_InformationLink(problem,interpretation,object,_); | ||
62432 | check(numberOfExistingReferences < 1); | ||
62433 | missingMultiplicity == eval(1-numberOfExistingReferences); | ||
62434 | } | ||
62435 | pattern unfinishedLowerMultiplicity_type_attribute_Function(problem:LogicProblem, interpretation:PartialInterpretation, relationIterpretation:PartialRelationInterpretation, object:DefinedElement,missingMultiplicity) { | ||
62436 | find interpretation(problem,interpretation); | ||
62437 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
62438 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"type attribute Function"); | ||
62439 | find mustInstanceOfFunction_class(problem,interpretation,object); | ||
62440 | numberOfExistingReferences == count find mustInRelationtype_attribute_Function(problem,interpretation,object,_); | ||
62441 | check(numberOfExistingReferences < 1); | ||
62442 | missingMultiplicity == eval(1-numberOfExistingReferences); | ||
62443 | } | ||
62444 | |||
62445 | ////////// | ||
62446 | // 3.2 Unfinishedness Measured by WF Queries | ||
62447 | ////////// | ||
62448 | |||
62449 | ////////// | ||
62450 | // 4. Refinement Indexers | ||
62451 | ////////// | ||
62452 | // 4.1 Object constructors | ||
62453 | ////////// | ||
62454 | private pattern hasElementInContainment(problem:LogicProblem, interpretation:PartialInterpretation) | ||
62455 | { | ||
62456 | find interpretation(problem,interpretation); | ||
62457 | find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,root); | ||
62458 | find mustExist(problem, interpretation, root); | ||
62459 | }or{ | ||
62460 | find interpretation(problem,interpretation); | ||
62461 | find mustInstanceOfFunctionalInput_class(problem,interpretation,root); | ||
62462 | find mustExist(problem, interpretation, root); | ||
62463 | }or{ | ||
62464 | find interpretation(problem,interpretation); | ||
62465 | find mustInstanceOfFunctionalOutput_class(problem,interpretation,root); | ||
62466 | find mustExist(problem, interpretation, root); | ||
62467 | }or{ | ||
62468 | find interpretation(problem,interpretation); | ||
62469 | find mustInstanceOfFAMTerminator_class(problem,interpretation,root); | ||
62470 | find mustExist(problem, interpretation, root); | ||
62471 | }or{ | ||
62472 | find interpretation(problem,interpretation); | ||
62473 | find mustInstanceOfFunctionalInterface_class(problem,interpretation,root); | ||
62474 | find mustExist(problem, interpretation, root); | ||
62475 | }or{ | ||
62476 | find interpretation(problem,interpretation); | ||
62477 | find mustInstanceOfFunction_class(problem,interpretation,root); | ||
62478 | find mustExist(problem, interpretation, root); | ||
62479 | }or{ | ||
62480 | find interpretation(problem,interpretation); | ||
62481 | find mustInstanceOfInformationLink_class(problem,interpretation,root); | ||
62482 | find mustExist(problem, interpretation, root); | ||
62483 | }or{ | ||
62484 | find interpretation(problem,interpretation); | ||
62485 | find mustInstanceOfFunctionalElement_class(problem,interpretation,root); | ||
62486 | find mustExist(problem, interpretation, root); | ||
62487 | }or{ | ||
62488 | find interpretation(problem,interpretation); | ||
62489 | find mustInstanceOfFunctionalData_class(problem,interpretation,root); | ||
62490 | find mustExist(problem, interpretation, root); | ||
62491 | } | ||
62492 | pattern createObject_Function_class_by_rootElements_reference_FunctionalArchitectureModel( | ||
62493 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
62494 | relationInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
62495 | container:DefinedElement) | ||
62496 | { | ||
62497 | find interpretation(problem,interpretation); | ||
62498 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
62499 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"Function class"); | ||
62500 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
62501 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"rootElements reference FunctionalArchitectureModel"); | ||
62502 | find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,container); | ||
62503 | find mayInstanceOfFunction_class(problem,interpretation,newObject); | ||
62504 | find mayInRelationrootElements_reference_FunctionalArchitectureModel(problem,interpretation,container,newObject); | ||
62505 | find mustExist(problem, interpretation, container); | ||
62506 | neg find mustExist(problem, interpretation, newObject); | ||
62507 | } | ||
62508 | pattern createObject_Function_class_by_subElements_reference_Function_with_parent_reference_FunctionalElement( | ||
62509 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
62510 | relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
62511 | container:DefinedElement) | ||
62512 | { | ||
62513 | find interpretation(problem,interpretation); | ||
62514 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
62515 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"Function class"); | ||
62516 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
62517 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"subElements reference Function"); | ||
62518 | PartialInterpretation.partialrelationinterpretation(interpretation,inverseInterpretation); | ||
62519 | PartialRelationInterpretation.interpretationOf.name(inverseInterpretation,"parent reference FunctionalElement"); | ||
62520 | find mustInstanceOfFunction_class(problem,interpretation,container); | ||
62521 | find mayInstanceOfFunction_class(problem,interpretation,newObject); | ||
62522 | find mayInRelationsubElements_reference_Function(problem,interpretation,container,newObject); | ||
62523 | find mustExist(problem, interpretation, container); | ||
62524 | neg find mustExist(problem, interpretation, newObject); | ||
62525 | } | ||
62526 | pattern createObject_Function_class( | ||
62527 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
62528 | typeInterpretation:PartialComplexTypeInterpretation) | ||
62529 | { | ||
62530 | find interpretation(problem,interpretation); | ||
62531 | neg find hasElementInContainment(problem,interpretation); | ||
62532 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
62533 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"Function class"); | ||
62534 | find mayInstanceOfFunction_class(problem,interpretation,newObject); | ||
62535 | find mayExist(problem, interpretation, newObject); | ||
62536 | neg find mustExist(problem, interpretation, newObject); | ||
62537 | } | ||
62538 | pattern createObject_FunctionalInterface_class_by_interface_reference_FunctionalElement_with_element_reference_FunctionalInterface( | ||
62539 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
62540 | relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
62541 | container:DefinedElement) | ||
62542 | { | ||
62543 | find interpretation(problem,interpretation); | ||
62544 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
62545 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalInterface class"); | ||
62546 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
62547 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"interface reference FunctionalElement"); | ||
62548 | PartialInterpretation.partialrelationinterpretation(interpretation,inverseInterpretation); | ||
62549 | PartialRelationInterpretation.interpretationOf.name(inverseInterpretation,"element reference FunctionalInterface"); | ||
62550 | find mustInstanceOfFunctionalElement_class(problem,interpretation,container); | ||
62551 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,newObject); | ||
62552 | find mayInRelationinterface_reference_FunctionalElement(problem,interpretation,container,newObject); | ||
62553 | find mustExist(problem, interpretation, container); | ||
62554 | neg find mustExist(problem, interpretation, newObject); | ||
62555 | } | ||
62556 | pattern createObject_FunctionalInterface_class( | ||
62557 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
62558 | typeInterpretation:PartialComplexTypeInterpretation) | ||
62559 | { | ||
62560 | find interpretation(problem,interpretation); | ||
62561 | neg find hasElementInContainment(problem,interpretation); | ||
62562 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
62563 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalInterface class"); | ||
62564 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,newObject); | ||
62565 | find mayExist(problem, interpretation, newObject); | ||
62566 | neg find mustExist(problem, interpretation, newObject); | ||
62567 | } | ||
62568 | pattern createObject_InformationLink_class_by_outgoingLinks_reference_FunctionalOutput_with_from_reference_InformationLink( | ||
62569 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
62570 | relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
62571 | container:DefinedElement) | ||
62572 | { | ||
62573 | find interpretation(problem,interpretation); | ||
62574 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
62575 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"InformationLink class"); | ||
62576 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
62577 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"outgoingLinks reference FunctionalOutput"); | ||
62578 | PartialInterpretation.partialrelationinterpretation(interpretation,inverseInterpretation); | ||
62579 | PartialRelationInterpretation.interpretationOf.name(inverseInterpretation,"from reference InformationLink"); | ||
62580 | find mustInstanceOfFunctionalOutput_class(problem,interpretation,container); | ||
62581 | find mayInstanceOfInformationLink_class(problem,interpretation,newObject); | ||
62582 | find mayInRelationoutgoingLinks_reference_FunctionalOutput(problem,interpretation,container,newObject); | ||
62583 | find mustExist(problem, interpretation, container); | ||
62584 | neg find mustExist(problem, interpretation, newObject); | ||
62585 | } | ||
62586 | pattern createObject_InformationLink_class( | ||
62587 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
62588 | typeInterpretation:PartialComplexTypeInterpretation) | ||
62589 | { | ||
62590 | find interpretation(problem,interpretation); | ||
62591 | neg find hasElementInContainment(problem,interpretation); | ||
62592 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
62593 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"InformationLink class"); | ||
62594 | find mayInstanceOfInformationLink_class(problem,interpretation,newObject); | ||
62595 | find mayExist(problem, interpretation, newObject); | ||
62596 | neg find mustExist(problem, interpretation, newObject); | ||
62597 | } | ||
62598 | pattern createObject_FAMTerminator_class_by_terminator_reference_FunctionalData_with_data_reference_FAMTerminator( | ||
62599 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
62600 | relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
62601 | container:DefinedElement) | ||
62602 | { | ||
62603 | find interpretation(problem,interpretation); | ||
62604 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
62605 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FAMTerminator class"); | ||
62606 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
62607 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"terminator reference FunctionalData"); | ||
62608 | PartialInterpretation.partialrelationinterpretation(interpretation,inverseInterpretation); | ||
62609 | PartialRelationInterpretation.interpretationOf.name(inverseInterpretation,"data reference FAMTerminator"); | ||
62610 | find mustInstanceOfFunctionalData_class(problem,interpretation,container); | ||
62611 | find mayInstanceOfFAMTerminator_class(problem,interpretation,newObject); | ||
62612 | find mayInRelationterminator_reference_FunctionalData(problem,interpretation,container,newObject); | ||
62613 | find mustExist(problem, interpretation, container); | ||
62614 | neg find mustExist(problem, interpretation, newObject); | ||
62615 | } | ||
62616 | pattern createObject_FAMTerminator_class( | ||
62617 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
62618 | typeInterpretation:PartialComplexTypeInterpretation) | ||
62619 | { | ||
62620 | find interpretation(problem,interpretation); | ||
62621 | neg find hasElementInContainment(problem,interpretation); | ||
62622 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
62623 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FAMTerminator class"); | ||
62624 | find mayInstanceOfFAMTerminator_class(problem,interpretation,newObject); | ||
62625 | find mayExist(problem, interpretation, newObject); | ||
62626 | neg find mustExist(problem, interpretation, newObject); | ||
62627 | } | ||
62628 | pattern createObject_FunctionalInput_class_by_data_reference_FunctionalInterface_with_interface_reference_FunctionalData( | ||
62629 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
62630 | relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
62631 | container:DefinedElement) | ||
62632 | { | ||
62633 | find interpretation(problem,interpretation); | ||
62634 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
62635 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalInput class"); | ||
62636 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
62637 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"data reference FunctionalInterface"); | ||
62638 | PartialInterpretation.partialrelationinterpretation(interpretation,inverseInterpretation); | ||
62639 | PartialRelationInterpretation.interpretationOf.name(inverseInterpretation,"interface reference FunctionalData"); | ||
62640 | find mustInstanceOfFunctionalInterface_class(problem,interpretation,container); | ||
62641 | find mayInstanceOfFunctionalInput_class(problem,interpretation,newObject); | ||
62642 | find mayInRelationdata_reference_FunctionalInterface(problem,interpretation,container,newObject); | ||
62643 | find mustExist(problem, interpretation, container); | ||
62644 | neg find mustExist(problem, interpretation, newObject); | ||
62645 | } | ||
62646 | pattern createObject_FunctionalInput_class( | ||
62647 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
62648 | typeInterpretation:PartialComplexTypeInterpretation) | ||
62649 | { | ||
62650 | find interpretation(problem,interpretation); | ||
62651 | neg find hasElementInContainment(problem,interpretation); | ||
62652 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
62653 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalInput class"); | ||
62654 | find mayInstanceOfFunctionalInput_class(problem,interpretation,newObject); | ||
62655 | find mayExist(problem, interpretation, newObject); | ||
62656 | neg find mustExist(problem, interpretation, newObject); | ||
62657 | } | ||
62658 | pattern createObject_FunctionalOutput_class_by_data_reference_FunctionalInterface_with_interface_reference_FunctionalData( | ||
62659 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
62660 | relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
62661 | container:DefinedElement) | ||
62662 | { | ||
62663 | find interpretation(problem,interpretation); | ||
62664 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
62665 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalOutput class"); | ||
62666 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
62667 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"data reference FunctionalInterface"); | ||
62668 | PartialInterpretation.partialrelationinterpretation(interpretation,inverseInterpretation); | ||
62669 | PartialRelationInterpretation.interpretationOf.name(inverseInterpretation,"interface reference FunctionalData"); | ||
62670 | find mustInstanceOfFunctionalInterface_class(problem,interpretation,container); | ||
62671 | find mayInstanceOfFunctionalOutput_class(problem,interpretation,newObject); | ||
62672 | find mayInRelationdata_reference_FunctionalInterface(problem,interpretation,container,newObject); | ||
62673 | find mustExist(problem, interpretation, container); | ||
62674 | neg find mustExist(problem, interpretation, newObject); | ||
62675 | } | ||
62676 | pattern createObject_FunctionalOutput_class( | ||
62677 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
62678 | typeInterpretation:PartialComplexTypeInterpretation) | ||
62679 | { | ||
62680 | find interpretation(problem,interpretation); | ||
62681 | neg find hasElementInContainment(problem,interpretation); | ||
62682 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
62683 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalOutput class"); | ||
62684 | find mayInstanceOfFunctionalOutput_class(problem,interpretation,newObject); | ||
62685 | find mayExist(problem, interpretation, newObject); | ||
62686 | neg find mustExist(problem, interpretation, newObject); | ||
62687 | } | ||
62688 | pattern createObject_FunctionalArchitectureModel_class( | ||
62689 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
62690 | typeInterpretation:PartialComplexTypeInterpretation) | ||
62691 | { | ||
62692 | find interpretation(problem,interpretation); | ||
62693 | neg find hasElementInContainment(problem,interpretation); | ||
62694 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
62695 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalArchitectureModel class"); | ||
62696 | find mayInstanceOfFunctionalArchitectureModel_class(problem,interpretation,newObject); | ||
62697 | find mayExist(problem, interpretation, newObject); | ||
62698 | neg find mustExist(problem, interpretation, newObject); | ||
62699 | } | ||
62700 | |||
62701 | ////////// | ||
62702 | // 4.2 Type refinement | ||
62703 | ////////// | ||
62704 | pattern refineTypeTo_Function_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
62705 | find interpretation(problem,interpretation); | ||
62706 | PartialInterpretation.newElements(interpretation,element); | ||
62707 | find mayInstanceOfFunction_class(problem,interpretation,element); | ||
62708 | neg find mustInstanceOfFunction_class(problem,interpretation,element); | ||
62709 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
62710 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
62711 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
62712 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
62713 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
62714 | } | ||
62715 | pattern refineTypeTo_FunctionalInterface_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
62716 | find interpretation(problem,interpretation); | ||
62717 | PartialInterpretation.newElements(interpretation,element); | ||
62718 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
62719 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
62720 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
62721 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
62722 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
62723 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
62724 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
62725 | } | ||
62726 | pattern refineTypeTo_InformationLink_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
62727 | find interpretation(problem,interpretation); | ||
62728 | PartialInterpretation.newElements(interpretation,element); | ||
62729 | find mayInstanceOfInformationLink_class(problem,interpretation,element); | ||
62730 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
62731 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
62732 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
62733 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
62734 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
62735 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
62736 | } | ||
62737 | pattern refineTypeTo_FAMTerminator_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
62738 | find interpretation(problem,interpretation); | ||
62739 | PartialInterpretation.newElements(interpretation,element); | ||
62740 | find mayInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
62741 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
62742 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
62743 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
62744 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
62745 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
62746 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
62747 | } | ||
62748 | pattern refineTypeTo_FunctionalInput_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
62749 | find interpretation(problem,interpretation); | ||
62750 | PartialInterpretation.newElements(interpretation,element); | ||
62751 | find mayInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
62752 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
62753 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
62754 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
62755 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
62756 | neg find mustInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
62757 | neg find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
62758 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
62759 | } | ||
62760 | pattern refineTypeTo_FunctionalOutput_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
62761 | find interpretation(problem,interpretation); | ||
62762 | PartialInterpretation.newElements(interpretation,element); | ||
62763 | find mayInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
62764 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
62765 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
62766 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
62767 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
62768 | neg find mustInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
62769 | neg find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
62770 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
62771 | } | ||
62772 | pattern refineTypeTo_FunctionalArchitectureModel_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
62773 | find interpretation(problem,interpretation); | ||
62774 | PartialInterpretation.newElements(interpretation,element); | ||
62775 | find mayInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
62776 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
62777 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
62778 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
62779 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
62780 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
62781 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
62782 | } | ||
62783 | |||
62784 | ////////// | ||
62785 | // 4.3 Relation refinement | ||
62786 | ////////// | ||
62787 | pattern refineRelation_model_reference_FunctionalElement( | ||
62788 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
62789 | relationIterpretation:PartialRelationInterpretation, | ||
62790 | from: DefinedElement, to: DefinedElement) | ||
62791 | { | ||
62792 | find interpretation(problem,interpretation); | ||
62793 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
62794 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"model reference FunctionalElement"); | ||
62795 | find mustExist(problem, interpretation, from); | ||
62796 | find mustExist(problem, interpretation, to); | ||
62797 | find mustInstanceOfFunctionalElement_class(problem,interpretation,from); | ||
62798 | find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,to); | ||
62799 | find mayInRelationmodel_reference_FunctionalElement(problem,interpretation,from,to); | ||
62800 | neg find mustInRelationmodel_reference_FunctionalElement(problem,interpretation,from,to); | ||
62801 | } | ||
62802 | pattern refineRelation_IncomingLinks_reference_FunctionalInput_and_to_reference_InformationLink( | ||
62803 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
62804 | relationIterpretation:PartialRelationInterpretation, oppositeInterpretation:PartialRelationInterpretation, | ||
62805 | from: DefinedElement, to: DefinedElement) | ||
62806 | { | ||
62807 | find interpretation(problem,interpretation); | ||
62808 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
62809 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"IncomingLinks reference FunctionalInput"); | ||
62810 | PartialInterpretation.partialrelationinterpretation(interpretation,oppositeInterpretation); | ||
62811 | PartialRelationInterpretation.interpretationOf.name(oppositeInterpretation,"to reference InformationLink"); | ||
62812 | find mustExist(problem, interpretation, from); | ||
62813 | find mustExist(problem, interpretation, to); | ||
62814 | find mustInstanceOfFunctionalInput_class(problem,interpretation,from); | ||
62815 | find mustInstanceOfInformationLink_class(problem,interpretation,to); | ||
62816 | find mayInRelationIncomingLinks_reference_FunctionalInput(problem,interpretation,from,to); | ||
62817 | neg find mustInRelationIncomingLinks_reference_FunctionalInput(problem,interpretation,from,to); | ||
62818 | } | ||
62819 | pattern refineRelation_type_attribute_Function( | ||
62820 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
62821 | relationIterpretation:PartialRelationInterpretation, | ||
62822 | from: DefinedElement, to: DefinedElement) | ||
62823 | { | ||
62824 | find interpretation(problem,interpretation); | ||
62825 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
62826 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"type attribute Function"); | ||
62827 | find mustExist(problem, interpretation, from); | ||
62828 | find mustExist(problem, interpretation, to); | ||
62829 | find mustInstanceOfFunction_class(problem,interpretation,from); | ||
62830 | find mustInstanceOfFunctionType_enum(problem,interpretation,to); | ||
62831 | find mayInRelationtype_attribute_Function(problem,interpretation,from,to); | ||
62832 | neg find mustInRelationtype_attribute_Function(problem,interpretation,from,to); | ||
62833 | } | ||
62834 | import epackage "http://www.bme.hu/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage" | ||
62835 | import epackage "http://www.bme.hu/mit/inf/dslreasoner/logic/model/problem" | ||
62836 | import epackage "http://www.bme.hu/mit/inf/dslreasoner/logic/model/language" | ||
62837 | |||
62838 | ////////// | ||
62839 | // 0. Util | ||
62840 | ////////// | ||
62841 | private pattern interpretation(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
62842 | PartialInterpretation.problem(interpretation,problem); | ||
62843 | } | ||
62844 | |||
62845 | ///////////////////////// | ||
62846 | // 0.1 Existence | ||
62847 | ///////////////////////// | ||
62848 | private pattern mustExist(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
62849 | find interpretation(problem,interpretation); | ||
62850 | LogicProblem.elements(problem,element); | ||
62851 | } or { | ||
62852 | find interpretation(problem,interpretation); | ||
62853 | PartialInterpretation.newElements(interpretation,element); | ||
62854 | } | ||
62855 | |||
62856 | private pattern mayExist(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
62857 | find mustExist(problem,interpretation,element); | ||
62858 | } or { | ||
62859 | find interpretation(problem,interpretation); | ||
62860 | neg find elementCloseWorld(element); | ||
62861 | PartialInterpretation.openWorldElements(interpretation,element); | ||
62862 | } | ||
62863 | |||
62864 | private pattern elementCloseWorld(element:DefinedElement) { | ||
62865 | PartialInterpretation.openWorldElements(i,element); | ||
62866 | PartialInterpretation.maxNewElements(i,0); | ||
62867 | } or { | ||
62868 | Scope.targetTypeInterpretation(scope,interpretation); | ||
62869 | PartialTypeInterpratation.elements(interpretation,element); | ||
62870 | Scope.maxNewElements(scope,0); | ||
62871 | } | ||
62872 | |||
62873 | //////////////////////// | ||
62874 | // 0.2 Equivalence | ||
62875 | //////////////////////// | ||
62876 | pattern mayEquivalent(problem:LogicProblem, interpretation:PartialInterpretation, a: DefinedElement, b: DefinedElement) { | ||
62877 | find mayExist(problem,interpretation,a); | ||
62878 | find mayExist(problem,interpretation,b); | ||
62879 | a == b; | ||
62880 | } | ||
62881 | |||
62882 | //////////////////////// | ||
62883 | // 0.3 Required Patterns by TypeIndexer | ||
62884 | //////////////////////// | ||
62885 | private pattern typeInterpretation(problem:LogicProblem, interpretation:PartialInterpretation, type:TypeDeclaration, typeInterpretation:PartialComplexTypeInterpretation) { | ||
62886 | find interpretation(problem,interpretation); | ||
62887 | LogicProblem.types(problem,type); | ||
62888 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
62889 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
62890 | } | ||
62891 | |||
62892 | private pattern directInstanceOf(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement, type:Type) { | ||
62893 | find interpretation(problem,interpretation); | ||
62894 | LogicProblem.types(problem,type); | ||
62895 | TypeDefinition.elements(type,element); | ||
62896 | } or { | ||
62897 | find interpretation(problem,interpretation); | ||
62898 | find typeInterpretation(problem,interpretation,type,typeInterpretation); | ||
62899 | PartialComplexTypeInterpretation.elements(typeInterpretation,element); | ||
62900 | } | ||
62901 | |||
62902 | private pattern isPrimitive(element: PrimitiveElement) { | ||
62903 | PrimitiveElement(element); | ||
62904 | } | ||
62905 | |||
62906 | ////////// | ||
62907 | // 1. Problem-Specific Base Indexers | ||
62908 | ////////// | ||
62909 | // 1.1 Type Indexers | ||
62910 | ////////// | ||
62911 | // 1.1.1 primitive Type Indexers | ||
62912 | ////////// | ||
62913 | |||
62914 | ////////// | ||
62915 | // 1.1.2 domain-specific Type Indexers | ||
62916 | ////////// | ||
62917 | /** | ||
62918 | * An element must be an instance of type "FunctionalElement class". | ||
62919 | */ | ||
62920 | private pattern mustInstanceOfFunctionalElement_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
62921 | Type.name(type,"FunctionalElement class"); | ||
62922 | find directInstanceOf(problem,interpretation,element,type); | ||
62923 | } | ||
62924 | private pattern scopeDisallowsNewFunctionalElement_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
62925 | find interpretation(problem,interpretation); | ||
62926 | PartialInterpretation.scopes(interpretation,scope); | ||
62927 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
62928 | Scope.maxNewElements(scope,0); | ||
62929 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
62930 | Type.name(type,"FunctionalElement class"); | ||
62931 | } | ||
62932 | |||
62933 | /** | ||
62934 | * An element may be an instance of type "FunctionalElement class". | ||
62935 | */ | ||
62936 | private pattern mayInstanceOfFunctionalElement_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
62937 | { | ||
62938 | find interpretation(problem,interpretation); | ||
62939 | PartialInterpretation.newElements(interpretation,element); | ||
62940 | neg find mustInstanceOfFunction_class(problem,interpretation,element); | ||
62941 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
62942 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
62943 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
62944 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
62945 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
62946 | neg find scopeDisallowsNewFunctionalElement_class(problem, interpretation); | ||
62947 | neg find isPrimitive(element); | ||
62948 | } or { | ||
62949 | find interpretation(problem,interpretation); | ||
62950 | PartialInterpretation.openWorldElements(interpretation,element); | ||
62951 | neg find mustInstanceOfFunction_class(problem,interpretation,element); | ||
62952 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
62953 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
62954 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
62955 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
62956 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
62957 | neg find scopeDisallowsNewFunctionalElement_class(problem, interpretation); | ||
62958 | neg find isPrimitive(element); | ||
62959 | } or | ||
62960 | { find mustInstanceOfFunctionalElement_class(problem,interpretation,element); } | ||
62961 | /** | ||
62962 | * An element must be an instance of type "FunctionalArchitectureModel class". | ||
62963 | */ | ||
62964 | private pattern mustInstanceOfFunctionalArchitectureModel_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
62965 | Type.name(type,"FunctionalArchitectureModel class"); | ||
62966 | find directInstanceOf(problem,interpretation,element,type); | ||
62967 | } | ||
62968 | private pattern scopeDisallowsNewFunctionalArchitectureModel_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
62969 | find interpretation(problem,interpretation); | ||
62970 | PartialInterpretation.scopes(interpretation,scope); | ||
62971 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
62972 | Scope.maxNewElements(scope,0); | ||
62973 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
62974 | Type.name(type,"FunctionalArchitectureModel class"); | ||
62975 | } | ||
62976 | |||
62977 | /** | ||
62978 | * An element may be an instance of type "FunctionalArchitectureModel class". | ||
62979 | */ | ||
62980 | private pattern mayInstanceOfFunctionalArchitectureModel_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
62981 | { | ||
62982 | find interpretation(problem,interpretation); | ||
62983 | PartialInterpretation.newElements(interpretation,element); | ||
62984 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
62985 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
62986 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
62987 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
62988 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
62989 | neg find scopeDisallowsNewFunctionalArchitectureModel_class(problem, interpretation); | ||
62990 | neg find isPrimitive(element); | ||
62991 | } or { | ||
62992 | find interpretation(problem,interpretation); | ||
62993 | PartialInterpretation.openWorldElements(interpretation,element); | ||
62994 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
62995 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
62996 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
62997 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
62998 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
62999 | neg find scopeDisallowsNewFunctionalArchitectureModel_class(problem, interpretation); | ||
63000 | neg find isPrimitive(element); | ||
63001 | } or | ||
63002 | { find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); } | ||
63003 | /** | ||
63004 | * An element must be an instance of type "Function class". | ||
63005 | */ | ||
63006 | private pattern mustInstanceOfFunction_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
63007 | Type.name(type,"Function class"); | ||
63008 | find directInstanceOf(problem,interpretation,element,type); | ||
63009 | } | ||
63010 | private pattern scopeDisallowsNewFunction_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
63011 | find interpretation(problem,interpretation); | ||
63012 | PartialInterpretation.scopes(interpretation,scope); | ||
63013 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
63014 | Scope.maxNewElements(scope,0); | ||
63015 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
63016 | Type.name(type,"Function class"); | ||
63017 | } | ||
63018 | |||
63019 | /** | ||
63020 | * An element may be an instance of type "Function class". | ||
63021 | */ | ||
63022 | private pattern mayInstanceOfFunction_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
63023 | { | ||
63024 | find interpretation(problem,interpretation); | ||
63025 | PartialInterpretation.newElements(interpretation,element); | ||
63026 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
63027 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
63028 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
63029 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
63030 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
63031 | neg find scopeDisallowsNewFunction_class(problem, interpretation); | ||
63032 | neg find isPrimitive(element); | ||
63033 | } or { | ||
63034 | find interpretation(problem,interpretation); | ||
63035 | PartialInterpretation.openWorldElements(interpretation,element); | ||
63036 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
63037 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
63038 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
63039 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
63040 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
63041 | neg find scopeDisallowsNewFunction_class(problem, interpretation); | ||
63042 | neg find isPrimitive(element); | ||
63043 | } or | ||
63044 | { find mustInstanceOfFunction_class(problem,interpretation,element); } | ||
63045 | /** | ||
63046 | * An element must be an instance of type "FAMTerminator class". | ||
63047 | */ | ||
63048 | private pattern mustInstanceOfFAMTerminator_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
63049 | Type.name(type,"FAMTerminator class"); | ||
63050 | find directInstanceOf(problem,interpretation,element,type); | ||
63051 | } | ||
63052 | private pattern scopeDisallowsNewFAMTerminator_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
63053 | find interpretation(problem,interpretation); | ||
63054 | PartialInterpretation.scopes(interpretation,scope); | ||
63055 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
63056 | Scope.maxNewElements(scope,0); | ||
63057 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
63058 | Type.name(type,"FAMTerminator class"); | ||
63059 | } | ||
63060 | |||
63061 | /** | ||
63062 | * An element may be an instance of type "FAMTerminator class". | ||
63063 | */ | ||
63064 | private pattern mayInstanceOfFAMTerminator_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
63065 | { | ||
63066 | find interpretation(problem,interpretation); | ||
63067 | PartialInterpretation.newElements(interpretation,element); | ||
63068 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
63069 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
63070 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
63071 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
63072 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
63073 | neg find scopeDisallowsNewFAMTerminator_class(problem, interpretation); | ||
63074 | neg find isPrimitive(element); | ||
63075 | } or { | ||
63076 | find interpretation(problem,interpretation); | ||
63077 | PartialInterpretation.openWorldElements(interpretation,element); | ||
63078 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
63079 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
63080 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
63081 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
63082 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
63083 | neg find scopeDisallowsNewFAMTerminator_class(problem, interpretation); | ||
63084 | neg find isPrimitive(element); | ||
63085 | } or | ||
63086 | { find mustInstanceOfFAMTerminator_class(problem,interpretation,element); } | ||
63087 | /** | ||
63088 | * An element must be an instance of type "InformationLink class". | ||
63089 | */ | ||
63090 | private pattern mustInstanceOfInformationLink_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
63091 | Type.name(type,"InformationLink class"); | ||
63092 | find directInstanceOf(problem,interpretation,element,type); | ||
63093 | } | ||
63094 | private pattern scopeDisallowsNewInformationLink_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
63095 | find interpretation(problem,interpretation); | ||
63096 | PartialInterpretation.scopes(interpretation,scope); | ||
63097 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
63098 | Scope.maxNewElements(scope,0); | ||
63099 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
63100 | Type.name(type,"InformationLink class"); | ||
63101 | } | ||
63102 | |||
63103 | /** | ||
63104 | * An element may be an instance of type "InformationLink class". | ||
63105 | */ | ||
63106 | private pattern mayInstanceOfInformationLink_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
63107 | { | ||
63108 | find interpretation(problem,interpretation); | ||
63109 | PartialInterpretation.newElements(interpretation,element); | ||
63110 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
63111 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
63112 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
63113 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
63114 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
63115 | neg find scopeDisallowsNewInformationLink_class(problem, interpretation); | ||
63116 | neg find isPrimitive(element); | ||
63117 | } or { | ||
63118 | find interpretation(problem,interpretation); | ||
63119 | PartialInterpretation.openWorldElements(interpretation,element); | ||
63120 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
63121 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
63122 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
63123 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
63124 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
63125 | neg find scopeDisallowsNewInformationLink_class(problem, interpretation); | ||
63126 | neg find isPrimitive(element); | ||
63127 | } or | ||
63128 | { find mustInstanceOfInformationLink_class(problem,interpretation,element); } | ||
63129 | /** | ||
63130 | * An element must be an instance of type "FunctionalInterface class". | ||
63131 | */ | ||
63132 | private pattern mustInstanceOfFunctionalInterface_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
63133 | Type.name(type,"FunctionalInterface class"); | ||
63134 | find directInstanceOf(problem,interpretation,element,type); | ||
63135 | } | ||
63136 | private pattern scopeDisallowsNewFunctionalInterface_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
63137 | find interpretation(problem,interpretation); | ||
63138 | PartialInterpretation.scopes(interpretation,scope); | ||
63139 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
63140 | Scope.maxNewElements(scope,0); | ||
63141 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
63142 | Type.name(type,"FunctionalInterface class"); | ||
63143 | } | ||
63144 | |||
63145 | /** | ||
63146 | * An element may be an instance of type "FunctionalInterface class". | ||
63147 | */ | ||
63148 | private pattern mayInstanceOfFunctionalInterface_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
63149 | { | ||
63150 | find interpretation(problem,interpretation); | ||
63151 | PartialInterpretation.newElements(interpretation,element); | ||
63152 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
63153 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
63154 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
63155 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
63156 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
63157 | neg find scopeDisallowsNewFunctionalInterface_class(problem, interpretation); | ||
63158 | neg find isPrimitive(element); | ||
63159 | } or { | ||
63160 | find interpretation(problem,interpretation); | ||
63161 | PartialInterpretation.openWorldElements(interpretation,element); | ||
63162 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
63163 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
63164 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
63165 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
63166 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
63167 | neg find scopeDisallowsNewFunctionalInterface_class(problem, interpretation); | ||
63168 | neg find isPrimitive(element); | ||
63169 | } or | ||
63170 | { find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); } | ||
63171 | /** | ||
63172 | * An element must be an instance of type "FunctionalInput class". | ||
63173 | */ | ||
63174 | private pattern mustInstanceOfFunctionalInput_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
63175 | Type.name(type,"FunctionalInput class"); | ||
63176 | find directInstanceOf(problem,interpretation,element,type); | ||
63177 | } | ||
63178 | private pattern scopeDisallowsNewFunctionalInput_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
63179 | find interpretation(problem,interpretation); | ||
63180 | PartialInterpretation.scopes(interpretation,scope); | ||
63181 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
63182 | Scope.maxNewElements(scope,0); | ||
63183 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
63184 | Type.name(type,"FunctionalInput class"); | ||
63185 | } | ||
63186 | |||
63187 | /** | ||
63188 | * An element may be an instance of type "FunctionalInput class". | ||
63189 | */ | ||
63190 | private pattern mayInstanceOfFunctionalInput_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
63191 | { | ||
63192 | find interpretation(problem,interpretation); | ||
63193 | PartialInterpretation.newElements(interpretation,element); | ||
63194 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
63195 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
63196 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
63197 | neg find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
63198 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
63199 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
63200 | neg find scopeDisallowsNewFunctionalInput_class(problem, interpretation); | ||
63201 | neg find isPrimitive(element); | ||
63202 | } or { | ||
63203 | find interpretation(problem,interpretation); | ||
63204 | PartialInterpretation.openWorldElements(interpretation,element); | ||
63205 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
63206 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
63207 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
63208 | neg find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
63209 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
63210 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
63211 | neg find scopeDisallowsNewFunctionalInput_class(problem, interpretation); | ||
63212 | neg find isPrimitive(element); | ||
63213 | } or | ||
63214 | { find mustInstanceOfFunctionalInput_class(problem,interpretation,element); } | ||
63215 | /** | ||
63216 | * An element must be an instance of type "FunctionalOutput class". | ||
63217 | */ | ||
63218 | private pattern mustInstanceOfFunctionalOutput_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
63219 | Type.name(type,"FunctionalOutput class"); | ||
63220 | find directInstanceOf(problem,interpretation,element,type); | ||
63221 | } | ||
63222 | private pattern scopeDisallowsNewFunctionalOutput_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
63223 | find interpretation(problem,interpretation); | ||
63224 | PartialInterpretation.scopes(interpretation,scope); | ||
63225 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
63226 | Scope.maxNewElements(scope,0); | ||
63227 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
63228 | Type.name(type,"FunctionalOutput class"); | ||
63229 | } | ||
63230 | |||
63231 | /** | ||
63232 | * An element may be an instance of type "FunctionalOutput class". | ||
63233 | */ | ||
63234 | private pattern mayInstanceOfFunctionalOutput_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
63235 | { | ||
63236 | find interpretation(problem,interpretation); | ||
63237 | PartialInterpretation.newElements(interpretation,element); | ||
63238 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
63239 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
63240 | neg find mustInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
63241 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
63242 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
63243 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
63244 | neg find scopeDisallowsNewFunctionalOutput_class(problem, interpretation); | ||
63245 | neg find isPrimitive(element); | ||
63246 | } or { | ||
63247 | find interpretation(problem,interpretation); | ||
63248 | PartialInterpretation.openWorldElements(interpretation,element); | ||
63249 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
63250 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
63251 | neg find mustInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
63252 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
63253 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
63254 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
63255 | neg find scopeDisallowsNewFunctionalOutput_class(problem, interpretation); | ||
63256 | neg find isPrimitive(element); | ||
63257 | } or | ||
63258 | { find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); } | ||
63259 | /** | ||
63260 | * An element must be an instance of type "FunctionalData class". | ||
63261 | */ | ||
63262 | private pattern mustInstanceOfFunctionalData_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
63263 | Type.name(type,"FunctionalData class"); | ||
63264 | find directInstanceOf(problem,interpretation,element,type); | ||
63265 | } | ||
63266 | private pattern scopeDisallowsNewFunctionalData_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
63267 | find interpretation(problem,interpretation); | ||
63268 | PartialInterpretation.scopes(interpretation,scope); | ||
63269 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
63270 | Scope.maxNewElements(scope,0); | ||
63271 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
63272 | Type.name(type,"FunctionalData class"); | ||
63273 | } | ||
63274 | |||
63275 | /** | ||
63276 | * An element may be an instance of type "FunctionalData class". | ||
63277 | */ | ||
63278 | private pattern mayInstanceOfFunctionalData_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
63279 | { | ||
63280 | find interpretation(problem,interpretation); | ||
63281 | PartialInterpretation.newElements(interpretation,element); | ||
63282 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
63283 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
63284 | neg find mustInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
63285 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
63286 | neg find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
63287 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
63288 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
63289 | neg find scopeDisallowsNewFunctionalData_class(problem, interpretation); | ||
63290 | neg find isPrimitive(element); | ||
63291 | } or { | ||
63292 | find interpretation(problem,interpretation); | ||
63293 | PartialInterpretation.openWorldElements(interpretation,element); | ||
63294 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
63295 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
63296 | neg find mustInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
63297 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
63298 | neg find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
63299 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
63300 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
63301 | neg find scopeDisallowsNewFunctionalData_class(problem, interpretation); | ||
63302 | neg find isPrimitive(element); | ||
63303 | } or | ||
63304 | { find mustInstanceOfFunctionalData_class(problem,interpretation,element); } | ||
63305 | /** | ||
63306 | * An element must be an instance of type "FunctionType enum". | ||
63307 | */ | ||
63308 | private pattern mustInstanceOfFunctionType_enum(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
63309 | Type.name(type,"FunctionType enum"); | ||
63310 | find directInstanceOf(problem,interpretation,element,type); | ||
63311 | } | ||
63312 | private pattern scopeDisallowsNewFunctionType_enum(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
63313 | find interpretation(problem,interpretation); | ||
63314 | PartialInterpretation.scopes(interpretation,scope); | ||
63315 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
63316 | Scope.maxNewElements(scope,0); | ||
63317 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
63318 | Type.name(type,"FunctionType enum"); | ||
63319 | } | ||
63320 | |||
63321 | /** | ||
63322 | * An element may be an instance of type "FunctionType enum". | ||
63323 | */ | ||
63324 | private pattern mayInstanceOfFunctionType_enum(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
63325 | { find mustInstanceOfFunctionType_enum(problem,interpretation,element); } | ||
63326 | |||
63327 | ////////// | ||
63328 | // 1.2 Relation Declaration Indexers | ||
63329 | ////////// | ||
63330 | /** | ||
63331 | * Matcher for detecting tuples t where []interface reference FunctionalElement(source,target) | ||
63332 | */ | ||
63333 | private pattern mustInRelationinterface_reference_FunctionalElement( | ||
63334 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
63335 | source: DefinedElement, target:DefinedElement) | ||
63336 | { | ||
63337 | find interpretation(problem,interpretation); | ||
63338 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
63339 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"interface reference FunctionalElement"); | ||
63340 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
63341 | BinaryElementRelationLink.param1(link,source); | ||
63342 | BinaryElementRelationLink.param2(link,target); | ||
63343 | } | ||
63344 | /** | ||
63345 | * Matcher for detecting tuples t where <>interface reference FunctionalElement(source,target) | ||
63346 | */ | ||
63347 | private pattern mayInRelationinterface_reference_FunctionalElement( | ||
63348 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
63349 | source: DefinedElement, target:DefinedElement) | ||
63350 | { | ||
63351 | find interpretation(problem,interpretation); | ||
63352 | // The two endpoint of the link have to exist | ||
63353 | find mayExist(problem, interpretation, source); | ||
63354 | find mayExist(problem, interpretation, target); | ||
63355 | // Type consistency | ||
63356 | find mayInstanceOfFunctionalElement_class(problem,interpretation,source); | ||
63357 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,target); | ||
63358 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
63359 | // the upper bound of the multiplicity should be considered. | ||
63360 | numberOfExistingReferences == count find mustInRelationinterface_reference_FunctionalElement(problem,interpretation,source,_); | ||
63361 | check(numberOfExistingReferences < 1); | ||
63362 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
63363 | // the upper bound of the opposite reference multiplicity should be considered. | ||
63364 | numberOfExistingOppositeReferences == count find mustInRelationelement_reference_FunctionalInterface(problem,interpretation,target,_); | ||
63365 | check(numberOfExistingOppositeReferences < 1); | ||
63366 | // The reference is containment, then a new reference cannot be create if: | ||
63367 | // 1. Multiple parents | ||
63368 | neg find mustContains4(problem,interpretation,_,target); | ||
63369 | // 2. Circle in the containment hierarchy | ||
63370 | neg find mustTransitiveContains(source,target); | ||
63371 | } or { | ||
63372 | find mustInRelationinterface_reference_FunctionalElement(problem,interpretation,source,target); | ||
63373 | } | ||
63374 | /** | ||
63375 | * Matcher for detecting tuples t where []model reference FunctionalElement(source,target) | ||
63376 | */ | ||
63377 | private pattern mustInRelationmodel_reference_FunctionalElement( | ||
63378 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
63379 | source: DefinedElement, target:DefinedElement) | ||
63380 | { | ||
63381 | find interpretation(problem,interpretation); | ||
63382 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
63383 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"model reference FunctionalElement"); | ||
63384 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
63385 | BinaryElementRelationLink.param1(link,source); | ||
63386 | BinaryElementRelationLink.param2(link,target); | ||
63387 | } | ||
63388 | /** | ||
63389 | * Matcher for detecting tuples t where <>model reference FunctionalElement(source,target) | ||
63390 | */ | ||
63391 | private pattern mayInRelationmodel_reference_FunctionalElement( | ||
63392 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
63393 | source: DefinedElement, target:DefinedElement) | ||
63394 | { | ||
63395 | find interpretation(problem,interpretation); | ||
63396 | // The two endpoint of the link have to exist | ||
63397 | find mayExist(problem, interpretation, source); | ||
63398 | find mayExist(problem, interpretation, target); | ||
63399 | // Type consistency | ||
63400 | find mayInstanceOfFunctionalElement_class(problem,interpretation,source); | ||
63401 | find mayInstanceOfFunctionalArchitectureModel_class(problem,interpretation,target); | ||
63402 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
63403 | // the upper bound of the multiplicity should be considered. | ||
63404 | numberOfExistingReferences == count find mustInRelationmodel_reference_FunctionalElement(problem,interpretation,source,_); | ||
63405 | check(numberOfExistingReferences < 1); | ||
63406 | } or { | ||
63407 | find mustInRelationmodel_reference_FunctionalElement(problem,interpretation,source,target); | ||
63408 | } | ||
63409 | /** | ||
63410 | * Matcher for detecting tuples t where []parent reference FunctionalElement(source,target) | ||
63411 | */ | ||
63412 | private pattern mustInRelationparent_reference_FunctionalElement( | ||
63413 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
63414 | source: DefinedElement, target:DefinedElement) | ||
63415 | { | ||
63416 | find interpretation(problem,interpretation); | ||
63417 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
63418 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"parent reference FunctionalElement"); | ||
63419 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
63420 | BinaryElementRelationLink.param1(link,source); | ||
63421 | BinaryElementRelationLink.param2(link,target); | ||
63422 | } | ||
63423 | /** | ||
63424 | * Matcher for detecting tuples t where <>parent reference FunctionalElement(source,target) | ||
63425 | */ | ||
63426 | private pattern mayInRelationparent_reference_FunctionalElement( | ||
63427 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
63428 | source: DefinedElement, target:DefinedElement) | ||
63429 | { | ||
63430 | find interpretation(problem,interpretation); | ||
63431 | // The two endpoint of the link have to exist | ||
63432 | find mayExist(problem, interpretation, source); | ||
63433 | find mayExist(problem, interpretation, target); | ||
63434 | // Type consistency | ||
63435 | find mayInstanceOfFunctionalElement_class(problem,interpretation,source); | ||
63436 | find mayInstanceOfFunction_class(problem,interpretation,target); | ||
63437 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
63438 | // the upper bound of the multiplicity should be considered. | ||
63439 | numberOfExistingReferences == count find mustInRelationparent_reference_FunctionalElement(problem,interpretation,source,_); | ||
63440 | check(numberOfExistingReferences < 1); | ||
63441 | // The eOpposite of the reference is containment, then a referene cannot be created if | ||
63442 | // 1. Multiple parents | ||
63443 | neg find mustContains4(problem,interpretation,source,_); | ||
63444 | // 2. Circle in the containment hierarchy | ||
63445 | neg find mustTransitiveContains(source,target); | ||
63446 | } or { | ||
63447 | find mustInRelationparent_reference_FunctionalElement(problem,interpretation,source,target); | ||
63448 | } | ||
63449 | /** | ||
63450 | * Matcher for detecting tuples t where []rootElements reference FunctionalArchitectureModel(source,target) | ||
63451 | */ | ||
63452 | private pattern mustInRelationrootElements_reference_FunctionalArchitectureModel( | ||
63453 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
63454 | source: DefinedElement, target:DefinedElement) | ||
63455 | { | ||
63456 | find interpretation(problem,interpretation); | ||
63457 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
63458 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"rootElements reference FunctionalArchitectureModel"); | ||
63459 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
63460 | BinaryElementRelationLink.param1(link,source); | ||
63461 | BinaryElementRelationLink.param2(link,target); | ||
63462 | } | ||
63463 | /** | ||
63464 | * Matcher for detecting tuples t where <>rootElements reference FunctionalArchitectureModel(source,target) | ||
63465 | */ | ||
63466 | private pattern mayInRelationrootElements_reference_FunctionalArchitectureModel( | ||
63467 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
63468 | source: DefinedElement, target:DefinedElement) | ||
63469 | { | ||
63470 | find interpretation(problem,interpretation); | ||
63471 | // The two endpoint of the link have to exist | ||
63472 | find mayExist(problem, interpretation, source); | ||
63473 | find mayExist(problem, interpretation, target); | ||
63474 | // Type consistency | ||
63475 | find mayInstanceOfFunctionalArchitectureModel_class(problem,interpretation,source); | ||
63476 | find mayInstanceOfFunctionalElement_class(problem,interpretation,target); | ||
63477 | // The reference is containment, then a new reference cannot be create if: | ||
63478 | // 1. Multiple parents | ||
63479 | neg find mustContains4(problem,interpretation,_,target); | ||
63480 | // 2. Circle in the containment hierarchy | ||
63481 | neg find mustTransitiveContains(source,target); | ||
63482 | } or { | ||
63483 | find mustInRelationrootElements_reference_FunctionalArchitectureModel(problem,interpretation,source,target); | ||
63484 | } | ||
63485 | /** | ||
63486 | * Matcher for detecting tuples t where []subElements reference Function(source,target) | ||
63487 | */ | ||
63488 | private pattern mustInRelationsubElements_reference_Function( | ||
63489 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
63490 | source: DefinedElement, target:DefinedElement) | ||
63491 | { | ||
63492 | find interpretation(problem,interpretation); | ||
63493 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
63494 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"subElements reference Function"); | ||
63495 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
63496 | BinaryElementRelationLink.param1(link,source); | ||
63497 | BinaryElementRelationLink.param2(link,target); | ||
63498 | } | ||
63499 | /** | ||
63500 | * Matcher for detecting tuples t where <>subElements reference Function(source,target) | ||
63501 | */ | ||
63502 | private pattern mayInRelationsubElements_reference_Function( | ||
63503 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
63504 | source: DefinedElement, target:DefinedElement) | ||
63505 | { | ||
63506 | find interpretation(problem,interpretation); | ||
63507 | // The two endpoint of the link have to exist | ||
63508 | find mayExist(problem, interpretation, source); | ||
63509 | find mayExist(problem, interpretation, target); | ||
63510 | // Type consistency | ||
63511 | find mayInstanceOfFunction_class(problem,interpretation,source); | ||
63512 | find mayInstanceOfFunctionalElement_class(problem,interpretation,target); | ||
63513 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
63514 | // the upper bound of the opposite reference multiplicity should be considered. | ||
63515 | numberOfExistingOppositeReferences == count find mustInRelationparent_reference_FunctionalElement(problem,interpretation,target,_); | ||
63516 | check(numberOfExistingOppositeReferences < 1); | ||
63517 | // The reference is containment, then a new reference cannot be create if: | ||
63518 | // 1. Multiple parents | ||
63519 | neg find mustContains4(problem,interpretation,_,target); | ||
63520 | // 2. Circle in the containment hierarchy | ||
63521 | neg find mustTransitiveContains(source,target); | ||
63522 | } or { | ||
63523 | find mustInRelationsubElements_reference_Function(problem,interpretation,source,target); | ||
63524 | } | ||
63525 | /** | ||
63526 | * Matcher for detecting tuples t where []data reference FAMTerminator(source,target) | ||
63527 | */ | ||
63528 | private pattern mustInRelationdata_reference_FAMTerminator( | ||
63529 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
63530 | source: DefinedElement, target:DefinedElement) | ||
63531 | { | ||
63532 | find interpretation(problem,interpretation); | ||
63533 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
63534 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"data reference FAMTerminator"); | ||
63535 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
63536 | BinaryElementRelationLink.param1(link,source); | ||
63537 | BinaryElementRelationLink.param2(link,target); | ||
63538 | } | ||
63539 | /** | ||
63540 | * Matcher for detecting tuples t where <>data reference FAMTerminator(source,target) | ||
63541 | */ | ||
63542 | private pattern mayInRelationdata_reference_FAMTerminator( | ||
63543 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
63544 | source: DefinedElement, target:DefinedElement) | ||
63545 | { | ||
63546 | find interpretation(problem,interpretation); | ||
63547 | // The two endpoint of the link have to exist | ||
63548 | find mayExist(problem, interpretation, source); | ||
63549 | find mayExist(problem, interpretation, target); | ||
63550 | // Type consistency | ||
63551 | find mayInstanceOfFAMTerminator_class(problem,interpretation,source); | ||
63552 | find mayInstanceOfFunctionalData_class(problem,interpretation,target); | ||
63553 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
63554 | // the upper bound of the multiplicity should be considered. | ||
63555 | numberOfExistingReferences == count find mustInRelationdata_reference_FAMTerminator(problem,interpretation,source,_); | ||
63556 | check(numberOfExistingReferences < 1); | ||
63557 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
63558 | // the upper bound of the opposite reference multiplicity should be considered. | ||
63559 | numberOfExistingOppositeReferences == count find mustInRelationterminator_reference_FunctionalData(problem,interpretation,target,_); | ||
63560 | check(numberOfExistingOppositeReferences < 1); | ||
63561 | // The eOpposite of the reference is containment, then a referene cannot be created if | ||
63562 | // 1. Multiple parents | ||
63563 | neg find mustContains4(problem,interpretation,source,_); | ||
63564 | // 2. Circle in the containment hierarchy | ||
63565 | neg find mustTransitiveContains(source,target); | ||
63566 | } or { | ||
63567 | find mustInRelationdata_reference_FAMTerminator(problem,interpretation,source,target); | ||
63568 | } | ||
63569 | /** | ||
63570 | * Matcher for detecting tuples t where []from reference InformationLink(source,target) | ||
63571 | */ | ||
63572 | private pattern mustInRelationfrom_reference_InformationLink( | ||
63573 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
63574 | source: DefinedElement, target:DefinedElement) | ||
63575 | { | ||
63576 | find interpretation(problem,interpretation); | ||
63577 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
63578 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"from reference InformationLink"); | ||
63579 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
63580 | BinaryElementRelationLink.param1(link,source); | ||
63581 | BinaryElementRelationLink.param2(link,target); | ||
63582 | } | ||
63583 | /** | ||
63584 | * Matcher for detecting tuples t where <>from reference InformationLink(source,target) | ||
63585 | */ | ||
63586 | private pattern mayInRelationfrom_reference_InformationLink( | ||
63587 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
63588 | source: DefinedElement, target:DefinedElement) | ||
63589 | { | ||
63590 | find interpretation(problem,interpretation); | ||
63591 | // The two endpoint of the link have to exist | ||
63592 | find mayExist(problem, interpretation, source); | ||
63593 | find mayExist(problem, interpretation, target); | ||
63594 | // Type consistency | ||
63595 | find mayInstanceOfInformationLink_class(problem,interpretation,source); | ||
63596 | find mayInstanceOfFunctionalOutput_class(problem,interpretation,target); | ||
63597 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
63598 | // the upper bound of the multiplicity should be considered. | ||
63599 | numberOfExistingReferences == count find mustInRelationfrom_reference_InformationLink(problem,interpretation,source,_); | ||
63600 | check(numberOfExistingReferences < 1); | ||
63601 | // The eOpposite of the reference is containment, then a referene cannot be created if | ||
63602 | // 1. Multiple parents | ||
63603 | neg find mustContains4(problem,interpretation,source,_); | ||
63604 | // 2. Circle in the containment hierarchy | ||
63605 | neg find mustTransitiveContains(source,target); | ||
63606 | } or { | ||
63607 | find mustInRelationfrom_reference_InformationLink(problem,interpretation,source,target); | ||
63608 | } | ||
63609 | /** | ||
63610 | * Matcher for detecting tuples t where []to reference InformationLink(source,target) | ||
63611 | */ | ||
63612 | private pattern mustInRelationto_reference_InformationLink( | ||
63613 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
63614 | source: DefinedElement, target:DefinedElement) | ||
63615 | { | ||
63616 | find interpretation(problem,interpretation); | ||
63617 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
63618 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"to reference InformationLink"); | ||
63619 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
63620 | BinaryElementRelationLink.param1(link,source); | ||
63621 | BinaryElementRelationLink.param2(link,target); | ||
63622 | } | ||
63623 | /** | ||
63624 | * Matcher for detecting tuples t where <>to reference InformationLink(source,target) | ||
63625 | */ | ||
63626 | private pattern mayInRelationto_reference_InformationLink( | ||
63627 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
63628 | source: DefinedElement, target:DefinedElement) | ||
63629 | { | ||
63630 | find interpretation(problem,interpretation); | ||
63631 | // The two endpoint of the link have to exist | ||
63632 | find mayExist(problem, interpretation, source); | ||
63633 | find mayExist(problem, interpretation, target); | ||
63634 | // Type consistency | ||
63635 | find mayInstanceOfInformationLink_class(problem,interpretation,source); | ||
63636 | find mayInstanceOfFunctionalInput_class(problem,interpretation,target); | ||
63637 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
63638 | // the upper bound of the multiplicity should be considered. | ||
63639 | numberOfExistingReferences == count find mustInRelationto_reference_InformationLink(problem,interpretation,source,_); | ||
63640 | check(numberOfExistingReferences < 1); | ||
63641 | } or { | ||
63642 | find mustInRelationto_reference_InformationLink(problem,interpretation,source,target); | ||
63643 | } | ||
63644 | /** | ||
63645 | * Matcher for detecting tuples t where []data reference FunctionalInterface(source,target) | ||
63646 | */ | ||
63647 | private pattern mustInRelationdata_reference_FunctionalInterface( | ||
63648 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
63649 | source: DefinedElement, target:DefinedElement) | ||
63650 | { | ||
63651 | find interpretation(problem,interpretation); | ||
63652 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
63653 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"data reference FunctionalInterface"); | ||
63654 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
63655 | BinaryElementRelationLink.param1(link,source); | ||
63656 | BinaryElementRelationLink.param2(link,target); | ||
63657 | } | ||
63658 | /** | ||
63659 | * Matcher for detecting tuples t where <>data reference FunctionalInterface(source,target) | ||
63660 | */ | ||
63661 | private pattern mayInRelationdata_reference_FunctionalInterface( | ||
63662 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
63663 | source: DefinedElement, target:DefinedElement) | ||
63664 | { | ||
63665 | find interpretation(problem,interpretation); | ||
63666 | // The two endpoint of the link have to exist | ||
63667 | find mayExist(problem, interpretation, source); | ||
63668 | find mayExist(problem, interpretation, target); | ||
63669 | // Type consistency | ||
63670 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,source); | ||
63671 | find mayInstanceOfFunctionalData_class(problem,interpretation,target); | ||
63672 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
63673 | // the upper bound of the opposite reference multiplicity should be considered. | ||
63674 | numberOfExistingOppositeReferences == count find mustInRelationinterface_reference_FunctionalData(problem,interpretation,target,_); | ||
63675 | check(numberOfExistingOppositeReferences < 1); | ||
63676 | // The reference is containment, then a new reference cannot be create if: | ||
63677 | // 1. Multiple parents | ||
63678 | neg find mustContains4(problem,interpretation,_,target); | ||
63679 | // 2. Circle in the containment hierarchy | ||
63680 | neg find mustTransitiveContains(source,target); | ||
63681 | } or { | ||
63682 | find mustInRelationdata_reference_FunctionalInterface(problem,interpretation,source,target); | ||
63683 | } | ||
63684 | /** | ||
63685 | * Matcher for detecting tuples t where []element reference FunctionalInterface(source,target) | ||
63686 | */ | ||
63687 | private pattern mustInRelationelement_reference_FunctionalInterface( | ||
63688 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
63689 | source: DefinedElement, target:DefinedElement) | ||
63690 | { | ||
63691 | find interpretation(problem,interpretation); | ||
63692 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
63693 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"element reference FunctionalInterface"); | ||
63694 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
63695 | BinaryElementRelationLink.param1(link,source); | ||
63696 | BinaryElementRelationLink.param2(link,target); | ||
63697 | } | ||
63698 | /** | ||
63699 | * Matcher for detecting tuples t where <>element reference FunctionalInterface(source,target) | ||
63700 | */ | ||
63701 | private pattern mayInRelationelement_reference_FunctionalInterface( | ||
63702 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
63703 | source: DefinedElement, target:DefinedElement) | ||
63704 | { | ||
63705 | find interpretation(problem,interpretation); | ||
63706 | // The two endpoint of the link have to exist | ||
63707 | find mayExist(problem, interpretation, source); | ||
63708 | find mayExist(problem, interpretation, target); | ||
63709 | // Type consistency | ||
63710 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,source); | ||
63711 | find mayInstanceOfFunctionalElement_class(problem,interpretation,target); | ||
63712 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
63713 | // the upper bound of the multiplicity should be considered. | ||
63714 | numberOfExistingReferences == count find mustInRelationelement_reference_FunctionalInterface(problem,interpretation,source,_); | ||
63715 | check(numberOfExistingReferences < 1); | ||
63716 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
63717 | // the upper bound of the opposite reference multiplicity should be considered. | ||
63718 | numberOfExistingOppositeReferences == count find mustInRelationinterface_reference_FunctionalElement(problem,interpretation,target,_); | ||
63719 | check(numberOfExistingOppositeReferences < 1); | ||
63720 | // The eOpposite of the reference is containment, then a referene cannot be created if | ||
63721 | // 1. Multiple parents | ||
63722 | neg find mustContains4(problem,interpretation,source,_); | ||
63723 | // 2. Circle in the containment hierarchy | ||
63724 | neg find mustTransitiveContains(source,target); | ||
63725 | } or { | ||
63726 | find mustInRelationelement_reference_FunctionalInterface(problem,interpretation,source,target); | ||
63727 | } | ||
63728 | /** | ||
63729 | * Matcher for detecting tuples t where []IncomingLinks reference FunctionalInput(source,target) | ||
63730 | */ | ||
63731 | private pattern mustInRelationIncomingLinks_reference_FunctionalInput( | ||
63732 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
63733 | source: DefinedElement, target:DefinedElement) | ||
63734 | { | ||
63735 | find interpretation(problem,interpretation); | ||
63736 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
63737 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"IncomingLinks reference FunctionalInput"); | ||
63738 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
63739 | BinaryElementRelationLink.param1(link,source); | ||
63740 | BinaryElementRelationLink.param2(link,target); | ||
63741 | } | ||
63742 | /** | ||
63743 | * Matcher for detecting tuples t where <>IncomingLinks reference FunctionalInput(source,target) | ||
63744 | */ | ||
63745 | private pattern mayInRelationIncomingLinks_reference_FunctionalInput( | ||
63746 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
63747 | source: DefinedElement, target:DefinedElement) | ||
63748 | { | ||
63749 | find interpretation(problem,interpretation); | ||
63750 | // The two endpoint of the link have to exist | ||
63751 | find mayExist(problem, interpretation, source); | ||
63752 | find mayExist(problem, interpretation, target); | ||
63753 | // Type consistency | ||
63754 | find mayInstanceOfFunctionalInput_class(problem,interpretation,source); | ||
63755 | find mayInstanceOfInformationLink_class(problem,interpretation,target); | ||
63756 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
63757 | // the upper bound of the opposite reference multiplicity should be considered. | ||
63758 | numberOfExistingOppositeReferences == count find mustInRelationto_reference_InformationLink(problem,interpretation,target,_); | ||
63759 | check(numberOfExistingOppositeReferences < 1); | ||
63760 | } or { | ||
63761 | find mustInRelationIncomingLinks_reference_FunctionalInput(problem,interpretation,source,target); | ||
63762 | } | ||
63763 | /** | ||
63764 | * Matcher for detecting tuples t where []outgoingLinks reference FunctionalOutput(source,target) | ||
63765 | */ | ||
63766 | private pattern mustInRelationoutgoingLinks_reference_FunctionalOutput( | ||
63767 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
63768 | source: DefinedElement, target:DefinedElement) | ||
63769 | { | ||
63770 | find interpretation(problem,interpretation); | ||
63771 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
63772 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"outgoingLinks reference FunctionalOutput"); | ||
63773 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
63774 | BinaryElementRelationLink.param1(link,source); | ||
63775 | BinaryElementRelationLink.param2(link,target); | ||
63776 | } | ||
63777 | /** | ||
63778 | * Matcher for detecting tuples t where <>outgoingLinks reference FunctionalOutput(source,target) | ||
63779 | */ | ||
63780 | private pattern mayInRelationoutgoingLinks_reference_FunctionalOutput( | ||
63781 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
63782 | source: DefinedElement, target:DefinedElement) | ||
63783 | { | ||
63784 | find interpretation(problem,interpretation); | ||
63785 | // The two endpoint of the link have to exist | ||
63786 | find mayExist(problem, interpretation, source); | ||
63787 | find mayExist(problem, interpretation, target); | ||
63788 | // Type consistency | ||
63789 | find mayInstanceOfFunctionalOutput_class(problem,interpretation,source); | ||
63790 | find mayInstanceOfInformationLink_class(problem,interpretation,target); | ||
63791 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
63792 | // the upper bound of the opposite reference multiplicity should be considered. | ||
63793 | numberOfExistingOppositeReferences == count find mustInRelationfrom_reference_InformationLink(problem,interpretation,target,_); | ||
63794 | check(numberOfExistingOppositeReferences < 1); | ||
63795 | // The reference is containment, then a new reference cannot be create if: | ||
63796 | // 1. Multiple parents | ||
63797 | neg find mustContains4(problem,interpretation,_,target); | ||
63798 | // 2. Circle in the containment hierarchy | ||
63799 | neg find mustTransitiveContains(source,target); | ||
63800 | } or { | ||
63801 | find mustInRelationoutgoingLinks_reference_FunctionalOutput(problem,interpretation,source,target); | ||
63802 | } | ||
63803 | /** | ||
63804 | * Matcher for detecting tuples t where []terminator reference FunctionalData(source,target) | ||
63805 | */ | ||
63806 | private pattern mustInRelationterminator_reference_FunctionalData( | ||
63807 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
63808 | source: DefinedElement, target:DefinedElement) | ||
63809 | { | ||
63810 | find interpretation(problem,interpretation); | ||
63811 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
63812 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"terminator reference FunctionalData"); | ||
63813 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
63814 | BinaryElementRelationLink.param1(link,source); | ||
63815 | BinaryElementRelationLink.param2(link,target); | ||
63816 | } | ||
63817 | /** | ||
63818 | * Matcher for detecting tuples t where <>terminator reference FunctionalData(source,target) | ||
63819 | */ | ||
63820 | private pattern mayInRelationterminator_reference_FunctionalData( | ||
63821 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
63822 | source: DefinedElement, target:DefinedElement) | ||
63823 | { | ||
63824 | find interpretation(problem,interpretation); | ||
63825 | // The two endpoint of the link have to exist | ||
63826 | find mayExist(problem, interpretation, source); | ||
63827 | find mayExist(problem, interpretation, target); | ||
63828 | // Type consistency | ||
63829 | find mayInstanceOfFunctionalData_class(problem,interpretation,source); | ||
63830 | find mayInstanceOfFAMTerminator_class(problem,interpretation,target); | ||
63831 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
63832 | // the upper bound of the multiplicity should be considered. | ||
63833 | numberOfExistingReferences == count find mustInRelationterminator_reference_FunctionalData(problem,interpretation,source,_); | ||
63834 | check(numberOfExistingReferences < 1); | ||
63835 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
63836 | // the upper bound of the opposite reference multiplicity should be considered. | ||
63837 | numberOfExistingOppositeReferences == count find mustInRelationdata_reference_FAMTerminator(problem,interpretation,target,_); | ||
63838 | check(numberOfExistingOppositeReferences < 1); | ||
63839 | // The reference is containment, then a new reference cannot be create if: | ||
63840 | // 1. Multiple parents | ||
63841 | neg find mustContains4(problem,interpretation,_,target); | ||
63842 | // 2. Circle in the containment hierarchy | ||
63843 | neg find mustTransitiveContains(source,target); | ||
63844 | } or { | ||
63845 | find mustInRelationterminator_reference_FunctionalData(problem,interpretation,source,target); | ||
63846 | } | ||
63847 | /** | ||
63848 | * Matcher for detecting tuples t where []interface reference FunctionalData(source,target) | ||
63849 | */ | ||
63850 | private pattern mustInRelationinterface_reference_FunctionalData( | ||
63851 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
63852 | source: DefinedElement, target:DefinedElement) | ||
63853 | { | ||
63854 | find interpretation(problem,interpretation); | ||
63855 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
63856 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"interface reference FunctionalData"); | ||
63857 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
63858 | BinaryElementRelationLink.param1(link,source); | ||
63859 | BinaryElementRelationLink.param2(link,target); | ||
63860 | } | ||
63861 | /** | ||
63862 | * Matcher for detecting tuples t where <>interface reference FunctionalData(source,target) | ||
63863 | */ | ||
63864 | private pattern mayInRelationinterface_reference_FunctionalData( | ||
63865 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
63866 | source: DefinedElement, target:DefinedElement) | ||
63867 | { | ||
63868 | find interpretation(problem,interpretation); | ||
63869 | // The two endpoint of the link have to exist | ||
63870 | find mayExist(problem, interpretation, source); | ||
63871 | find mayExist(problem, interpretation, target); | ||
63872 | // Type consistency | ||
63873 | find mayInstanceOfFunctionalData_class(problem,interpretation,source); | ||
63874 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,target); | ||
63875 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
63876 | // the upper bound of the multiplicity should be considered. | ||
63877 | numberOfExistingReferences == count find mustInRelationinterface_reference_FunctionalData(problem,interpretation,source,_); | ||
63878 | check(numberOfExistingReferences < 1); | ||
63879 | // The eOpposite of the reference is containment, then a referene cannot be created if | ||
63880 | // 1. Multiple parents | ||
63881 | neg find mustContains4(problem,interpretation,source,_); | ||
63882 | // 2. Circle in the containment hierarchy | ||
63883 | neg find mustTransitiveContains(source,target); | ||
63884 | } or { | ||
63885 | find mustInRelationinterface_reference_FunctionalData(problem,interpretation,source,target); | ||
63886 | } | ||
63887 | /** | ||
63888 | * Matcher for detecting tuples t where []type attribute Function(source,target) | ||
63889 | */ | ||
63890 | private pattern mustInRelationtype_attribute_Function( | ||
63891 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
63892 | source: DefinedElement, target:DefinedElement) | ||
63893 | { | ||
63894 | find interpretation(problem,interpretation); | ||
63895 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
63896 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"type attribute Function"); | ||
63897 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
63898 | BinaryElementRelationLink.param1(link,source); | ||
63899 | BinaryElementRelationLink.param2(link,target); | ||
63900 | } | ||
63901 | /** | ||
63902 | * Matcher for detecting tuples t where <>type attribute Function(source,target) | ||
63903 | */ | ||
63904 | private pattern mayInRelationtype_attribute_Function( | ||
63905 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
63906 | source: DefinedElement, target:DefinedElement) | ||
63907 | { | ||
63908 | find interpretation(problem,interpretation); | ||
63909 | // The two endpoint of the link have to exist | ||
63910 | find mayExist(problem, interpretation, source); | ||
63911 | find mayExist(problem, interpretation, target); | ||
63912 | // Type consistency | ||
63913 | find mayInstanceOfFunction_class(problem,interpretation,source); | ||
63914 | find mayInstanceOfFunctionType_enum(problem,interpretation,target); | ||
63915 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
63916 | // the upper bound of the multiplicity should be considered. | ||
63917 | numberOfExistingReferences == count find mustInRelationtype_attribute_Function(problem,interpretation,source,_); | ||
63918 | check(numberOfExistingReferences < 1); | ||
63919 | } or { | ||
63920 | find mustInRelationtype_attribute_Function(problem,interpretation,source,target); | ||
63921 | } | ||
63922 | |||
63923 | ////////// | ||
63924 | // 1.3 Relation Definition Indexers | ||
63925 | ////////// | ||
63926 | |||
63927 | ////////// | ||
63928 | // 1.4 Containment Indexer | ||
63929 | ////////// | ||
63930 | private pattern mustContains2(source: DefinedElement, target: DefinedElement) { | ||
63931 | find mustContains4(_,_,source,target); | ||
63932 | } | ||
63933 | |||
63934 | private pattern mustContains4(problem:LogicProblem, interpretation:PartialInterpretation, | ||
63935 | source: DefinedElement, target: DefinedElement) | ||
63936 | { find mustInRelationinterface_reference_FunctionalElement(problem,interpretation,source,target); }or | ||
63937 | |||
63938 | { find mustInRelationrootElements_reference_FunctionalArchitectureModel(problem,interpretation,source,target); }or | ||
63939 | |||
63940 | { find mustInRelationsubElements_reference_Function(problem,interpretation,source,target); }or | ||
63941 | |||
63942 | { find mustInRelationdata_reference_FunctionalInterface(problem,interpretation,source,target); }or | ||
63943 | |||
63944 | { find mustInRelationoutgoingLinks_reference_FunctionalOutput(problem,interpretation,source,target); }or | ||
63945 | |||
63946 | { find mustInRelationterminator_reference_FunctionalData(problem,interpretation,source,target); } | ||
63947 | |||
63948 | private pattern mustTransitiveContains(source,target) { | ||
63949 | find mustContains2+(source,target); | ||
63950 | } | ||
63951 | |||
63952 | ////////// | ||
63953 | // 2. Invalidation Indexers | ||
63954 | ////////// | ||
63955 | // 2.1 Invalidated by WF Queries | ||
63956 | ////////// | ||
63957 | |||
63958 | ////////// | ||
63959 | // 3. Unfinishedness Indexers | ||
63960 | ////////// | ||
63961 | // 3.1 Unfinishedness Measured by Multiplicity | ||
63962 | ////////// | ||
63963 | pattern unfinishedLowerMultiplicity_model_reference_FunctionalElement(problem:LogicProblem, interpretation:PartialInterpretation, relationIterpretation:PartialRelationInterpretation, object:DefinedElement,missingMultiplicity) { | ||
63964 | find interpretation(problem,interpretation); | ||
63965 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
63966 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"model reference FunctionalElement"); | ||
63967 | find mustInstanceOfFunctionalElement_class(problem,interpretation,object); | ||
63968 | numberOfExistingReferences == count find mustInRelationmodel_reference_FunctionalElement(problem,interpretation,object,_); | ||
63969 | check(numberOfExistingReferences < 1); | ||
63970 | missingMultiplicity == eval(1-numberOfExistingReferences); | ||
63971 | } | ||
63972 | pattern unfinishedLowerMultiplicity_to_reference_InformationLink(problem:LogicProblem, interpretation:PartialInterpretation, relationIterpretation:PartialRelationInterpretation, object:DefinedElement,missingMultiplicity) { | ||
63973 | find interpretation(problem,interpretation); | ||
63974 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
63975 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"to reference InformationLink"); | ||
63976 | find mustInstanceOfInformationLink_class(problem,interpretation,object); | ||
63977 | numberOfExistingReferences == count find mustInRelationto_reference_InformationLink(problem,interpretation,object,_); | ||
63978 | check(numberOfExistingReferences < 1); | ||
63979 | missingMultiplicity == eval(1-numberOfExistingReferences); | ||
63980 | } | ||
63981 | pattern unfinishedLowerMultiplicity_type_attribute_Function(problem:LogicProblem, interpretation:PartialInterpretation, relationIterpretation:PartialRelationInterpretation, object:DefinedElement,missingMultiplicity) { | ||
63982 | find interpretation(problem,interpretation); | ||
63983 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
63984 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"type attribute Function"); | ||
63985 | find mustInstanceOfFunction_class(problem,interpretation,object); | ||
63986 | numberOfExistingReferences == count find mustInRelationtype_attribute_Function(problem,interpretation,object,_); | ||
63987 | check(numberOfExistingReferences < 1); | ||
63988 | missingMultiplicity == eval(1-numberOfExistingReferences); | ||
63989 | } | ||
63990 | |||
63991 | ////////// | ||
63992 | // 3.2 Unfinishedness Measured by WF Queries | ||
63993 | ////////// | ||
63994 | |||
63995 | ////////// | ||
63996 | // 4. Refinement Indexers | ||
63997 | ////////// | ||
63998 | // 4.1 Object constructors | ||
63999 | ////////// | ||
64000 | private pattern hasElementInContainment(problem:LogicProblem, interpretation:PartialInterpretation) | ||
64001 | { | ||
64002 | find interpretation(problem,interpretation); | ||
64003 | find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,root); | ||
64004 | find mustExist(problem, interpretation, root); | ||
64005 | }or{ | ||
64006 | find interpretation(problem,interpretation); | ||
64007 | find mustInstanceOfFunctionalInput_class(problem,interpretation,root); | ||
64008 | find mustExist(problem, interpretation, root); | ||
64009 | }or{ | ||
64010 | find interpretation(problem,interpretation); | ||
64011 | find mustInstanceOfFunctionalOutput_class(problem,interpretation,root); | ||
64012 | find mustExist(problem, interpretation, root); | ||
64013 | }or{ | ||
64014 | find interpretation(problem,interpretation); | ||
64015 | find mustInstanceOfFAMTerminator_class(problem,interpretation,root); | ||
64016 | find mustExist(problem, interpretation, root); | ||
64017 | }or{ | ||
64018 | find interpretation(problem,interpretation); | ||
64019 | find mustInstanceOfFunctionalInterface_class(problem,interpretation,root); | ||
64020 | find mustExist(problem, interpretation, root); | ||
64021 | }or{ | ||
64022 | find interpretation(problem,interpretation); | ||
64023 | find mustInstanceOfFunction_class(problem,interpretation,root); | ||
64024 | find mustExist(problem, interpretation, root); | ||
64025 | }or{ | ||
64026 | find interpretation(problem,interpretation); | ||
64027 | find mustInstanceOfInformationLink_class(problem,interpretation,root); | ||
64028 | find mustExist(problem, interpretation, root); | ||
64029 | }or{ | ||
64030 | find interpretation(problem,interpretation); | ||
64031 | find mustInstanceOfFunctionalElement_class(problem,interpretation,root); | ||
64032 | find mustExist(problem, interpretation, root); | ||
64033 | }or{ | ||
64034 | find interpretation(problem,interpretation); | ||
64035 | find mustInstanceOfFunctionalData_class(problem,interpretation,root); | ||
64036 | find mustExist(problem, interpretation, root); | ||
64037 | } | ||
64038 | pattern createObject_Function_class_by_rootElements_reference_FunctionalArchitectureModel( | ||
64039 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
64040 | relationInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
64041 | container:DefinedElement) | ||
64042 | { | ||
64043 | find interpretation(problem,interpretation); | ||
64044 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
64045 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"Function class"); | ||
64046 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
64047 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"rootElements reference FunctionalArchitectureModel"); | ||
64048 | find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,container); | ||
64049 | find mayInstanceOfFunction_class(problem,interpretation,newObject); | ||
64050 | find mayInRelationrootElements_reference_FunctionalArchitectureModel(problem,interpretation,container,newObject); | ||
64051 | find mustExist(problem, interpretation, container); | ||
64052 | neg find mustExist(problem, interpretation, newObject); | ||
64053 | } | ||
64054 | pattern createObject_Function_class_by_subElements_reference_Function_with_parent_reference_FunctionalElement( | ||
64055 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
64056 | relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
64057 | container:DefinedElement) | ||
64058 | { | ||
64059 | find interpretation(problem,interpretation); | ||
64060 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
64061 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"Function class"); | ||
64062 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
64063 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"subElements reference Function"); | ||
64064 | PartialInterpretation.partialrelationinterpretation(interpretation,inverseInterpretation); | ||
64065 | PartialRelationInterpretation.interpretationOf.name(inverseInterpretation,"parent reference FunctionalElement"); | ||
64066 | find mustInstanceOfFunction_class(problem,interpretation,container); | ||
64067 | find mayInstanceOfFunction_class(problem,interpretation,newObject); | ||
64068 | find mayInRelationsubElements_reference_Function(problem,interpretation,container,newObject); | ||
64069 | find mustExist(problem, interpretation, container); | ||
64070 | neg find mustExist(problem, interpretation, newObject); | ||
64071 | } | ||
64072 | pattern createObject_Function_class( | ||
64073 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
64074 | typeInterpretation:PartialComplexTypeInterpretation) | ||
64075 | { | ||
64076 | find interpretation(problem,interpretation); | ||
64077 | neg find hasElementInContainment(problem,interpretation); | ||
64078 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
64079 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"Function class"); | ||
64080 | find mayInstanceOfFunction_class(problem,interpretation,newObject); | ||
64081 | find mayExist(problem, interpretation, newObject); | ||
64082 | neg find mustExist(problem, interpretation, newObject); | ||
64083 | } | ||
64084 | pattern createObject_InformationLink_class_by_outgoingLinks_reference_FunctionalOutput_with_from_reference_InformationLink( | ||
64085 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
64086 | relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
64087 | container:DefinedElement) | ||
64088 | { | ||
64089 | find interpretation(problem,interpretation); | ||
64090 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
64091 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"InformationLink class"); | ||
64092 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
64093 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"outgoingLinks reference FunctionalOutput"); | ||
64094 | PartialInterpretation.partialrelationinterpretation(interpretation,inverseInterpretation); | ||
64095 | PartialRelationInterpretation.interpretationOf.name(inverseInterpretation,"from reference InformationLink"); | ||
64096 | find mustInstanceOfFunctionalOutput_class(problem,interpretation,container); | ||
64097 | find mayInstanceOfInformationLink_class(problem,interpretation,newObject); | ||
64098 | find mayInRelationoutgoingLinks_reference_FunctionalOutput(problem,interpretation,container,newObject); | ||
64099 | find mustExist(problem, interpretation, container); | ||
64100 | neg find mustExist(problem, interpretation, newObject); | ||
64101 | } | ||
64102 | pattern createObject_InformationLink_class( | ||
64103 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
64104 | typeInterpretation:PartialComplexTypeInterpretation) | ||
64105 | { | ||
64106 | find interpretation(problem,interpretation); | ||
64107 | neg find hasElementInContainment(problem,interpretation); | ||
64108 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
64109 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"InformationLink class"); | ||
64110 | find mayInstanceOfInformationLink_class(problem,interpretation,newObject); | ||
64111 | find mayExist(problem, interpretation, newObject); | ||
64112 | neg find mustExist(problem, interpretation, newObject); | ||
64113 | } | ||
64114 | pattern createObject_FunctionalInterface_class_by_interface_reference_FunctionalElement_with_element_reference_FunctionalInterface( | ||
64115 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
64116 | relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
64117 | container:DefinedElement) | ||
64118 | { | ||
64119 | find interpretation(problem,interpretation); | ||
64120 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
64121 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalInterface class"); | ||
64122 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
64123 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"interface reference FunctionalElement"); | ||
64124 | PartialInterpretation.partialrelationinterpretation(interpretation,inverseInterpretation); | ||
64125 | PartialRelationInterpretation.interpretationOf.name(inverseInterpretation,"element reference FunctionalInterface"); | ||
64126 | find mustInstanceOfFunctionalElement_class(problem,interpretation,container); | ||
64127 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,newObject); | ||
64128 | find mayInRelationinterface_reference_FunctionalElement(problem,interpretation,container,newObject); | ||
64129 | find mustExist(problem, interpretation, container); | ||
64130 | neg find mustExist(problem, interpretation, newObject); | ||
64131 | } | ||
64132 | pattern createObject_FunctionalInterface_class( | ||
64133 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
64134 | typeInterpretation:PartialComplexTypeInterpretation) | ||
64135 | { | ||
64136 | find interpretation(problem,interpretation); | ||
64137 | neg find hasElementInContainment(problem,interpretation); | ||
64138 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
64139 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalInterface class"); | ||
64140 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,newObject); | ||
64141 | find mayExist(problem, interpretation, newObject); | ||
64142 | neg find mustExist(problem, interpretation, newObject); | ||
64143 | } | ||
64144 | pattern createObject_FunctionalInput_class_by_data_reference_FunctionalInterface_with_interface_reference_FunctionalData( | ||
64145 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
64146 | relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
64147 | container:DefinedElement) | ||
64148 | { | ||
64149 | find interpretation(problem,interpretation); | ||
64150 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
64151 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalInput class"); | ||
64152 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
64153 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"data reference FunctionalInterface"); | ||
64154 | PartialInterpretation.partialrelationinterpretation(interpretation,inverseInterpretation); | ||
64155 | PartialRelationInterpretation.interpretationOf.name(inverseInterpretation,"interface reference FunctionalData"); | ||
64156 | find mustInstanceOfFunctionalInterface_class(problem,interpretation,container); | ||
64157 | find mayInstanceOfFunctionalInput_class(problem,interpretation,newObject); | ||
64158 | find mayInRelationdata_reference_FunctionalInterface(problem,interpretation,container,newObject); | ||
64159 | find mustExist(problem, interpretation, container); | ||
64160 | neg find mustExist(problem, interpretation, newObject); | ||
64161 | } | ||
64162 | pattern createObject_FunctionalInput_class( | ||
64163 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
64164 | typeInterpretation:PartialComplexTypeInterpretation) | ||
64165 | { | ||
64166 | find interpretation(problem,interpretation); | ||
64167 | neg find hasElementInContainment(problem,interpretation); | ||
64168 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
64169 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalInput class"); | ||
64170 | find mayInstanceOfFunctionalInput_class(problem,interpretation,newObject); | ||
64171 | find mayExist(problem, interpretation, newObject); | ||
64172 | neg find mustExist(problem, interpretation, newObject); | ||
64173 | } | ||
64174 | pattern createObject_FunctionalArchitectureModel_class( | ||
64175 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
64176 | typeInterpretation:PartialComplexTypeInterpretation) | ||
64177 | { | ||
64178 | find interpretation(problem,interpretation); | ||
64179 | neg find hasElementInContainment(problem,interpretation); | ||
64180 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
64181 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalArchitectureModel class"); | ||
64182 | find mayInstanceOfFunctionalArchitectureModel_class(problem,interpretation,newObject); | ||
64183 | find mayExist(problem, interpretation, newObject); | ||
64184 | neg find mustExist(problem, interpretation, newObject); | ||
64185 | } | ||
64186 | pattern createObject_FunctionalOutput_class_by_data_reference_FunctionalInterface_with_interface_reference_FunctionalData( | ||
64187 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
64188 | relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
64189 | container:DefinedElement) | ||
64190 | { | ||
64191 | find interpretation(problem,interpretation); | ||
64192 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
64193 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalOutput class"); | ||
64194 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
64195 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"data reference FunctionalInterface"); | ||
64196 | PartialInterpretation.partialrelationinterpretation(interpretation,inverseInterpretation); | ||
64197 | PartialRelationInterpretation.interpretationOf.name(inverseInterpretation,"interface reference FunctionalData"); | ||
64198 | find mustInstanceOfFunctionalInterface_class(problem,interpretation,container); | ||
64199 | find mayInstanceOfFunctionalOutput_class(problem,interpretation,newObject); | ||
64200 | find mayInRelationdata_reference_FunctionalInterface(problem,interpretation,container,newObject); | ||
64201 | find mustExist(problem, interpretation, container); | ||
64202 | neg find mustExist(problem, interpretation, newObject); | ||
64203 | } | ||
64204 | pattern createObject_FunctionalOutput_class( | ||
64205 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
64206 | typeInterpretation:PartialComplexTypeInterpretation) | ||
64207 | { | ||
64208 | find interpretation(problem,interpretation); | ||
64209 | neg find hasElementInContainment(problem,interpretation); | ||
64210 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
64211 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalOutput class"); | ||
64212 | find mayInstanceOfFunctionalOutput_class(problem,interpretation,newObject); | ||
64213 | find mayExist(problem, interpretation, newObject); | ||
64214 | neg find mustExist(problem, interpretation, newObject); | ||
64215 | } | ||
64216 | pattern createObject_FAMTerminator_class_by_terminator_reference_FunctionalData_with_data_reference_FAMTerminator( | ||
64217 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
64218 | relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
64219 | container:DefinedElement) | ||
64220 | { | ||
64221 | find interpretation(problem,interpretation); | ||
64222 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
64223 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FAMTerminator class"); | ||
64224 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
64225 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"terminator reference FunctionalData"); | ||
64226 | PartialInterpretation.partialrelationinterpretation(interpretation,inverseInterpretation); | ||
64227 | PartialRelationInterpretation.interpretationOf.name(inverseInterpretation,"data reference FAMTerminator"); | ||
64228 | find mustInstanceOfFunctionalData_class(problem,interpretation,container); | ||
64229 | find mayInstanceOfFAMTerminator_class(problem,interpretation,newObject); | ||
64230 | find mayInRelationterminator_reference_FunctionalData(problem,interpretation,container,newObject); | ||
64231 | find mustExist(problem, interpretation, container); | ||
64232 | neg find mustExist(problem, interpretation, newObject); | ||
64233 | } | ||
64234 | pattern createObject_FAMTerminator_class( | ||
64235 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
64236 | typeInterpretation:PartialComplexTypeInterpretation) | ||
64237 | { | ||
64238 | find interpretation(problem,interpretation); | ||
64239 | neg find hasElementInContainment(problem,interpretation); | ||
64240 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
64241 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FAMTerminator class"); | ||
64242 | find mayInstanceOfFAMTerminator_class(problem,interpretation,newObject); | ||
64243 | find mayExist(problem, interpretation, newObject); | ||
64244 | neg find mustExist(problem, interpretation, newObject); | ||
64245 | } | ||
64246 | |||
64247 | ////////// | ||
64248 | // 4.2 Type refinement | ||
64249 | ////////// | ||
64250 | pattern refineTypeTo_Function_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
64251 | find interpretation(problem,interpretation); | ||
64252 | PartialInterpretation.newElements(interpretation,element); | ||
64253 | find mayInstanceOfFunction_class(problem,interpretation,element); | ||
64254 | neg find mustInstanceOfFunction_class(problem,interpretation,element); | ||
64255 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
64256 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
64257 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
64258 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
64259 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
64260 | } | ||
64261 | pattern refineTypeTo_InformationLink_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
64262 | find interpretation(problem,interpretation); | ||
64263 | PartialInterpretation.newElements(interpretation,element); | ||
64264 | find mayInstanceOfInformationLink_class(problem,interpretation,element); | ||
64265 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
64266 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
64267 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
64268 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
64269 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
64270 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
64271 | } | ||
64272 | pattern refineTypeTo_FunctionalInterface_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
64273 | find interpretation(problem,interpretation); | ||
64274 | PartialInterpretation.newElements(interpretation,element); | ||
64275 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
64276 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
64277 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
64278 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
64279 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
64280 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
64281 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
64282 | } | ||
64283 | pattern refineTypeTo_FunctionalInput_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
64284 | find interpretation(problem,interpretation); | ||
64285 | PartialInterpretation.newElements(interpretation,element); | ||
64286 | find mayInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
64287 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
64288 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
64289 | neg find mustInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
64290 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
64291 | neg find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
64292 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
64293 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
64294 | } | ||
64295 | pattern refineTypeTo_FunctionalArchitectureModel_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
64296 | find interpretation(problem,interpretation); | ||
64297 | PartialInterpretation.newElements(interpretation,element); | ||
64298 | find mayInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
64299 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
64300 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
64301 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
64302 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
64303 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
64304 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
64305 | } | ||
64306 | pattern refineTypeTo_FunctionalOutput_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
64307 | find interpretation(problem,interpretation); | ||
64308 | PartialInterpretation.newElements(interpretation,element); | ||
64309 | find mayInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
64310 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
64311 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
64312 | neg find mustInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
64313 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
64314 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
64315 | neg find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
64316 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
64317 | } | ||
64318 | pattern refineTypeTo_FAMTerminator_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
64319 | find interpretation(problem,interpretation); | ||
64320 | PartialInterpretation.newElements(interpretation,element); | ||
64321 | find mayInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
64322 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
64323 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
64324 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
64325 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
64326 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
64327 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
64328 | } | ||
64329 | |||
64330 | ////////// | ||
64331 | // 4.3 Relation refinement | ||
64332 | ////////// | ||
64333 | pattern refineRelation_model_reference_FunctionalElement( | ||
64334 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
64335 | relationIterpretation:PartialRelationInterpretation, | ||
64336 | from: DefinedElement, to: DefinedElement) | ||
64337 | { | ||
64338 | find interpretation(problem,interpretation); | ||
64339 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
64340 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"model reference FunctionalElement"); | ||
64341 | find mustExist(problem, interpretation, from); | ||
64342 | find mustExist(problem, interpretation, to); | ||
64343 | find mustInstanceOfFunctionalElement_class(problem,interpretation,from); | ||
64344 | find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,to); | ||
64345 | find mayInRelationmodel_reference_FunctionalElement(problem,interpretation,from,to); | ||
64346 | neg find mustInRelationmodel_reference_FunctionalElement(problem,interpretation,from,to); | ||
64347 | } | ||
64348 | pattern refineRelation_IncomingLinks_reference_FunctionalInput_and_to_reference_InformationLink( | ||
64349 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
64350 | relationIterpretation:PartialRelationInterpretation, oppositeInterpretation:PartialRelationInterpretation, | ||
64351 | from: DefinedElement, to: DefinedElement) | ||
64352 | { | ||
64353 | find interpretation(problem,interpretation); | ||
64354 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
64355 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"IncomingLinks reference FunctionalInput"); | ||
64356 | PartialInterpretation.partialrelationinterpretation(interpretation,oppositeInterpretation); | ||
64357 | PartialRelationInterpretation.interpretationOf.name(oppositeInterpretation,"to reference InformationLink"); | ||
64358 | find mustExist(problem, interpretation, from); | ||
64359 | find mustExist(problem, interpretation, to); | ||
64360 | find mustInstanceOfFunctionalInput_class(problem,interpretation,from); | ||
64361 | find mustInstanceOfInformationLink_class(problem,interpretation,to); | ||
64362 | find mayInRelationIncomingLinks_reference_FunctionalInput(problem,interpretation,from,to); | ||
64363 | neg find mustInRelationIncomingLinks_reference_FunctionalInput(problem,interpretation,from,to); | ||
64364 | } | ||
64365 | pattern refineRelation_type_attribute_Function( | ||
64366 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
64367 | relationIterpretation:PartialRelationInterpretation, | ||
64368 | from: DefinedElement, to: DefinedElement) | ||
64369 | { | ||
64370 | find interpretation(problem,interpretation); | ||
64371 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
64372 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"type attribute Function"); | ||
64373 | find mustExist(problem, interpretation, from); | ||
64374 | find mustExist(problem, interpretation, to); | ||
64375 | find mustInstanceOfFunction_class(problem,interpretation,from); | ||
64376 | find mustInstanceOfFunctionType_enum(problem,interpretation,to); | ||
64377 | find mayInRelationtype_attribute_Function(problem,interpretation,from,to); | ||
64378 | neg find mustInRelationtype_attribute_Function(problem,interpretation,from,to); | ||
64379 | } | ||
64380 | import epackage "http://www.bme.hu/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage" | ||
64381 | import epackage "http://www.bme.hu/mit/inf/dslreasoner/logic/model/problem" | ||
64382 | import epackage "http://www.bme.hu/mit/inf/dslreasoner/logic/model/language" | ||
64383 | |||
64384 | ////////// | ||
64385 | // 0. Util | ||
64386 | ////////// | ||
64387 | private pattern interpretation(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
64388 | PartialInterpretation.problem(interpretation,problem); | ||
64389 | } | ||
64390 | |||
64391 | ///////////////////////// | ||
64392 | // 0.1 Existence | ||
64393 | ///////////////////////// | ||
64394 | private pattern mustExist(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
64395 | find interpretation(problem,interpretation); | ||
64396 | LogicProblem.elements(problem,element); | ||
64397 | } or { | ||
64398 | find interpretation(problem,interpretation); | ||
64399 | PartialInterpretation.newElements(interpretation,element); | ||
64400 | } | ||
64401 | |||
64402 | private pattern mayExist(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
64403 | find mustExist(problem,interpretation,element); | ||
64404 | } or { | ||
64405 | find interpretation(problem,interpretation); | ||
64406 | neg find elementCloseWorld(element); | ||
64407 | PartialInterpretation.openWorldElements(interpretation,element); | ||
64408 | } | ||
64409 | |||
64410 | private pattern elementCloseWorld(element:DefinedElement) { | ||
64411 | PartialInterpretation.openWorldElements(i,element); | ||
64412 | PartialInterpretation.maxNewElements(i,0); | ||
64413 | } or { | ||
64414 | Scope.targetTypeInterpretation(scope,interpretation); | ||
64415 | PartialTypeInterpratation.elements(interpretation,element); | ||
64416 | Scope.maxNewElements(scope,0); | ||
64417 | } | ||
64418 | |||
64419 | //////////////////////// | ||
64420 | // 0.2 Equivalence | ||
64421 | //////////////////////// | ||
64422 | pattern mayEquivalent(problem:LogicProblem, interpretation:PartialInterpretation, a: DefinedElement, b: DefinedElement) { | ||
64423 | find mayExist(problem,interpretation,a); | ||
64424 | find mayExist(problem,interpretation,b); | ||
64425 | a == b; | ||
64426 | } | ||
64427 | |||
64428 | //////////////////////// | ||
64429 | // 0.3 Required Patterns by TypeIndexer | ||
64430 | //////////////////////// | ||
64431 | private pattern typeInterpretation(problem:LogicProblem, interpretation:PartialInterpretation, type:TypeDeclaration, typeInterpretation:PartialComplexTypeInterpretation) { | ||
64432 | find interpretation(problem,interpretation); | ||
64433 | LogicProblem.types(problem,type); | ||
64434 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
64435 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
64436 | } | ||
64437 | |||
64438 | private pattern directInstanceOf(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement, type:Type) { | ||
64439 | find interpretation(problem,interpretation); | ||
64440 | LogicProblem.types(problem,type); | ||
64441 | TypeDefinition.elements(type,element); | ||
64442 | } or { | ||
64443 | find interpretation(problem,interpretation); | ||
64444 | find typeInterpretation(problem,interpretation,type,typeInterpretation); | ||
64445 | PartialComplexTypeInterpretation.elements(typeInterpretation,element); | ||
64446 | } | ||
64447 | |||
64448 | private pattern isPrimitive(element: PrimitiveElement) { | ||
64449 | PrimitiveElement(element); | ||
64450 | } | ||
64451 | |||
64452 | ////////// | ||
64453 | // 1. Problem-Specific Base Indexers | ||
64454 | ////////// | ||
64455 | // 1.1 Type Indexers | ||
64456 | ////////// | ||
64457 | // 1.1.1 primitive Type Indexers | ||
64458 | ////////// | ||
64459 | |||
64460 | ////////// | ||
64461 | // 1.1.2 domain-specific Type Indexers | ||
64462 | ////////// | ||
64463 | /** | ||
64464 | * An element must be an instance of type "FunctionalElement class". | ||
64465 | */ | ||
64466 | private pattern mustInstanceOfFunctionalElement_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
64467 | Type.name(type,"FunctionalElement class"); | ||
64468 | find directInstanceOf(problem,interpretation,element,type); | ||
64469 | } | ||
64470 | private pattern scopeDisallowsNewFunctionalElement_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
64471 | find interpretation(problem,interpretation); | ||
64472 | PartialInterpretation.scopes(interpretation,scope); | ||
64473 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
64474 | Scope.maxNewElements(scope,0); | ||
64475 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
64476 | Type.name(type,"FunctionalElement class"); | ||
64477 | } | ||
64478 | |||
64479 | /** | ||
64480 | * An element may be an instance of type "FunctionalElement class". | ||
64481 | */ | ||
64482 | private pattern mayInstanceOfFunctionalElement_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
64483 | { | ||
64484 | find interpretation(problem,interpretation); | ||
64485 | PartialInterpretation.newElements(interpretation,element); | ||
64486 | neg find mustInstanceOfFunction_class(problem,interpretation,element); | ||
64487 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
64488 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
64489 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
64490 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
64491 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
64492 | neg find scopeDisallowsNewFunctionalElement_class(problem, interpretation); | ||
64493 | neg find isPrimitive(element); | ||
64494 | } or { | ||
64495 | find interpretation(problem,interpretation); | ||
64496 | PartialInterpretation.openWorldElements(interpretation,element); | ||
64497 | neg find mustInstanceOfFunction_class(problem,interpretation,element); | ||
64498 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
64499 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
64500 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
64501 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
64502 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
64503 | neg find scopeDisallowsNewFunctionalElement_class(problem, interpretation); | ||
64504 | neg find isPrimitive(element); | ||
64505 | } or | ||
64506 | { find mustInstanceOfFunctionalElement_class(problem,interpretation,element); } | ||
64507 | /** | ||
64508 | * An element must be an instance of type "FunctionalArchitectureModel class". | ||
64509 | */ | ||
64510 | private pattern mustInstanceOfFunctionalArchitectureModel_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
64511 | Type.name(type,"FunctionalArchitectureModel class"); | ||
64512 | find directInstanceOf(problem,interpretation,element,type); | ||
64513 | } | ||
64514 | private pattern scopeDisallowsNewFunctionalArchitectureModel_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
64515 | find interpretation(problem,interpretation); | ||
64516 | PartialInterpretation.scopes(interpretation,scope); | ||
64517 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
64518 | Scope.maxNewElements(scope,0); | ||
64519 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
64520 | Type.name(type,"FunctionalArchitectureModel class"); | ||
64521 | } | ||
64522 | |||
64523 | /** | ||
64524 | * An element may be an instance of type "FunctionalArchitectureModel class". | ||
64525 | */ | ||
64526 | private pattern mayInstanceOfFunctionalArchitectureModel_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
64527 | { | ||
64528 | find interpretation(problem,interpretation); | ||
64529 | PartialInterpretation.newElements(interpretation,element); | ||
64530 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
64531 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
64532 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
64533 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
64534 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
64535 | neg find scopeDisallowsNewFunctionalArchitectureModel_class(problem, interpretation); | ||
64536 | neg find isPrimitive(element); | ||
64537 | } or { | ||
64538 | find interpretation(problem,interpretation); | ||
64539 | PartialInterpretation.openWorldElements(interpretation,element); | ||
64540 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
64541 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
64542 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
64543 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
64544 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
64545 | neg find scopeDisallowsNewFunctionalArchitectureModel_class(problem, interpretation); | ||
64546 | neg find isPrimitive(element); | ||
64547 | } or | ||
64548 | { find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); } | ||
64549 | /** | ||
64550 | * An element must be an instance of type "Function class". | ||
64551 | */ | ||
64552 | private pattern mustInstanceOfFunction_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
64553 | Type.name(type,"Function class"); | ||
64554 | find directInstanceOf(problem,interpretation,element,type); | ||
64555 | } | ||
64556 | private pattern scopeDisallowsNewFunction_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
64557 | find interpretation(problem,interpretation); | ||
64558 | PartialInterpretation.scopes(interpretation,scope); | ||
64559 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
64560 | Scope.maxNewElements(scope,0); | ||
64561 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
64562 | Type.name(type,"Function class"); | ||
64563 | } | ||
64564 | |||
64565 | /** | ||
64566 | * An element may be an instance of type "Function class". | ||
64567 | */ | ||
64568 | private pattern mayInstanceOfFunction_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
64569 | { | ||
64570 | find interpretation(problem,interpretation); | ||
64571 | PartialInterpretation.newElements(interpretation,element); | ||
64572 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
64573 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
64574 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
64575 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
64576 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
64577 | neg find scopeDisallowsNewFunction_class(problem, interpretation); | ||
64578 | neg find isPrimitive(element); | ||
64579 | } or { | ||
64580 | find interpretation(problem,interpretation); | ||
64581 | PartialInterpretation.openWorldElements(interpretation,element); | ||
64582 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
64583 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
64584 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
64585 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
64586 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
64587 | neg find scopeDisallowsNewFunction_class(problem, interpretation); | ||
64588 | neg find isPrimitive(element); | ||
64589 | } or | ||
64590 | { find mustInstanceOfFunction_class(problem,interpretation,element); } | ||
64591 | /** | ||
64592 | * An element must be an instance of type "FAMTerminator class". | ||
64593 | */ | ||
64594 | private pattern mustInstanceOfFAMTerminator_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
64595 | Type.name(type,"FAMTerminator class"); | ||
64596 | find directInstanceOf(problem,interpretation,element,type); | ||
64597 | } | ||
64598 | private pattern scopeDisallowsNewFAMTerminator_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
64599 | find interpretation(problem,interpretation); | ||
64600 | PartialInterpretation.scopes(interpretation,scope); | ||
64601 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
64602 | Scope.maxNewElements(scope,0); | ||
64603 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
64604 | Type.name(type,"FAMTerminator class"); | ||
64605 | } | ||
64606 | |||
64607 | /** | ||
64608 | * An element may be an instance of type "FAMTerminator class". | ||
64609 | */ | ||
64610 | private pattern mayInstanceOfFAMTerminator_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
64611 | { | ||
64612 | find interpretation(problem,interpretation); | ||
64613 | PartialInterpretation.newElements(interpretation,element); | ||
64614 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
64615 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
64616 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
64617 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
64618 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
64619 | neg find scopeDisallowsNewFAMTerminator_class(problem, interpretation); | ||
64620 | neg find isPrimitive(element); | ||
64621 | } or { | ||
64622 | find interpretation(problem,interpretation); | ||
64623 | PartialInterpretation.openWorldElements(interpretation,element); | ||
64624 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
64625 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
64626 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
64627 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
64628 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
64629 | neg find scopeDisallowsNewFAMTerminator_class(problem, interpretation); | ||
64630 | neg find isPrimitive(element); | ||
64631 | } or | ||
64632 | { find mustInstanceOfFAMTerminator_class(problem,interpretation,element); } | ||
64633 | /** | ||
64634 | * An element must be an instance of type "InformationLink class". | ||
64635 | */ | ||
64636 | private pattern mustInstanceOfInformationLink_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
64637 | Type.name(type,"InformationLink class"); | ||
64638 | find directInstanceOf(problem,interpretation,element,type); | ||
64639 | } | ||
64640 | private pattern scopeDisallowsNewInformationLink_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
64641 | find interpretation(problem,interpretation); | ||
64642 | PartialInterpretation.scopes(interpretation,scope); | ||
64643 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
64644 | Scope.maxNewElements(scope,0); | ||
64645 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
64646 | Type.name(type,"InformationLink class"); | ||
64647 | } | ||
64648 | |||
64649 | /** | ||
64650 | * An element may be an instance of type "InformationLink class". | ||
64651 | */ | ||
64652 | private pattern mayInstanceOfInformationLink_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
64653 | { | ||
64654 | find interpretation(problem,interpretation); | ||
64655 | PartialInterpretation.newElements(interpretation,element); | ||
64656 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
64657 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
64658 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
64659 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
64660 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
64661 | neg find scopeDisallowsNewInformationLink_class(problem, interpretation); | ||
64662 | neg find isPrimitive(element); | ||
64663 | } or { | ||
64664 | find interpretation(problem,interpretation); | ||
64665 | PartialInterpretation.openWorldElements(interpretation,element); | ||
64666 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
64667 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
64668 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
64669 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
64670 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
64671 | neg find scopeDisallowsNewInformationLink_class(problem, interpretation); | ||
64672 | neg find isPrimitive(element); | ||
64673 | } or | ||
64674 | { find mustInstanceOfInformationLink_class(problem,interpretation,element); } | ||
64675 | /** | ||
64676 | * An element must be an instance of type "FunctionalInterface class". | ||
64677 | */ | ||
64678 | private pattern mustInstanceOfFunctionalInterface_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
64679 | Type.name(type,"FunctionalInterface class"); | ||
64680 | find directInstanceOf(problem,interpretation,element,type); | ||
64681 | } | ||
64682 | private pattern scopeDisallowsNewFunctionalInterface_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
64683 | find interpretation(problem,interpretation); | ||
64684 | PartialInterpretation.scopes(interpretation,scope); | ||
64685 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
64686 | Scope.maxNewElements(scope,0); | ||
64687 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
64688 | Type.name(type,"FunctionalInterface class"); | ||
64689 | } | ||
64690 | |||
64691 | /** | ||
64692 | * An element may be an instance of type "FunctionalInterface class". | ||
64693 | */ | ||
64694 | private pattern mayInstanceOfFunctionalInterface_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
64695 | { | ||
64696 | find interpretation(problem,interpretation); | ||
64697 | PartialInterpretation.newElements(interpretation,element); | ||
64698 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
64699 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
64700 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
64701 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
64702 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
64703 | neg find scopeDisallowsNewFunctionalInterface_class(problem, interpretation); | ||
64704 | neg find isPrimitive(element); | ||
64705 | } or { | ||
64706 | find interpretation(problem,interpretation); | ||
64707 | PartialInterpretation.openWorldElements(interpretation,element); | ||
64708 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
64709 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
64710 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
64711 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
64712 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
64713 | neg find scopeDisallowsNewFunctionalInterface_class(problem, interpretation); | ||
64714 | neg find isPrimitive(element); | ||
64715 | } or | ||
64716 | { find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); } | ||
64717 | /** | ||
64718 | * An element must be an instance of type "FunctionalInput class". | ||
64719 | */ | ||
64720 | private pattern mustInstanceOfFunctionalInput_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
64721 | Type.name(type,"FunctionalInput class"); | ||
64722 | find directInstanceOf(problem,interpretation,element,type); | ||
64723 | } | ||
64724 | private pattern scopeDisallowsNewFunctionalInput_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
64725 | find interpretation(problem,interpretation); | ||
64726 | PartialInterpretation.scopes(interpretation,scope); | ||
64727 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
64728 | Scope.maxNewElements(scope,0); | ||
64729 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
64730 | Type.name(type,"FunctionalInput class"); | ||
64731 | } | ||
64732 | |||
64733 | /** | ||
64734 | * An element may be an instance of type "FunctionalInput class". | ||
64735 | */ | ||
64736 | private pattern mayInstanceOfFunctionalInput_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
64737 | { | ||
64738 | find interpretation(problem,interpretation); | ||
64739 | PartialInterpretation.newElements(interpretation,element); | ||
64740 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
64741 | neg find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
64742 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
64743 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
64744 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
64745 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
64746 | neg find scopeDisallowsNewFunctionalInput_class(problem, interpretation); | ||
64747 | neg find isPrimitive(element); | ||
64748 | } or { | ||
64749 | find interpretation(problem,interpretation); | ||
64750 | PartialInterpretation.openWorldElements(interpretation,element); | ||
64751 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
64752 | neg find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
64753 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
64754 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
64755 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
64756 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
64757 | neg find scopeDisallowsNewFunctionalInput_class(problem, interpretation); | ||
64758 | neg find isPrimitive(element); | ||
64759 | } or | ||
64760 | { find mustInstanceOfFunctionalInput_class(problem,interpretation,element); } | ||
64761 | /** | ||
64762 | * An element must be an instance of type "FunctionalOutput class". | ||
64763 | */ | ||
64764 | private pattern mustInstanceOfFunctionalOutput_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
64765 | Type.name(type,"FunctionalOutput class"); | ||
64766 | find directInstanceOf(problem,interpretation,element,type); | ||
64767 | } | ||
64768 | private pattern scopeDisallowsNewFunctionalOutput_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
64769 | find interpretation(problem,interpretation); | ||
64770 | PartialInterpretation.scopes(interpretation,scope); | ||
64771 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
64772 | Scope.maxNewElements(scope,0); | ||
64773 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
64774 | Type.name(type,"FunctionalOutput class"); | ||
64775 | } | ||
64776 | |||
64777 | /** | ||
64778 | * An element may be an instance of type "FunctionalOutput class". | ||
64779 | */ | ||
64780 | private pattern mayInstanceOfFunctionalOutput_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
64781 | { | ||
64782 | find interpretation(problem,interpretation); | ||
64783 | PartialInterpretation.newElements(interpretation,element); | ||
64784 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
64785 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
64786 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
64787 | neg find mustInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
64788 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
64789 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
64790 | neg find scopeDisallowsNewFunctionalOutput_class(problem, interpretation); | ||
64791 | neg find isPrimitive(element); | ||
64792 | } or { | ||
64793 | find interpretation(problem,interpretation); | ||
64794 | PartialInterpretation.openWorldElements(interpretation,element); | ||
64795 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
64796 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
64797 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
64798 | neg find mustInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
64799 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
64800 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
64801 | neg find scopeDisallowsNewFunctionalOutput_class(problem, interpretation); | ||
64802 | neg find isPrimitive(element); | ||
64803 | } or | ||
64804 | { find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); } | ||
64805 | /** | ||
64806 | * An element must be an instance of type "FunctionalData class". | ||
64807 | */ | ||
64808 | private pattern mustInstanceOfFunctionalData_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
64809 | Type.name(type,"FunctionalData class"); | ||
64810 | find directInstanceOf(problem,interpretation,element,type); | ||
64811 | } | ||
64812 | private pattern scopeDisallowsNewFunctionalData_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
64813 | find interpretation(problem,interpretation); | ||
64814 | PartialInterpretation.scopes(interpretation,scope); | ||
64815 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
64816 | Scope.maxNewElements(scope,0); | ||
64817 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
64818 | Type.name(type,"FunctionalData class"); | ||
64819 | } | ||
64820 | |||
64821 | /** | ||
64822 | * An element may be an instance of type "FunctionalData class". | ||
64823 | */ | ||
64824 | private pattern mayInstanceOfFunctionalData_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
64825 | { | ||
64826 | find interpretation(problem,interpretation); | ||
64827 | PartialInterpretation.newElements(interpretation,element); | ||
64828 | neg find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
64829 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
64830 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
64831 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
64832 | neg find mustInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
64833 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
64834 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
64835 | neg find scopeDisallowsNewFunctionalData_class(problem, interpretation); | ||
64836 | neg find isPrimitive(element); | ||
64837 | } or { | ||
64838 | find interpretation(problem,interpretation); | ||
64839 | PartialInterpretation.openWorldElements(interpretation,element); | ||
64840 | neg find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
64841 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
64842 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
64843 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
64844 | neg find mustInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
64845 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
64846 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
64847 | neg find scopeDisallowsNewFunctionalData_class(problem, interpretation); | ||
64848 | neg find isPrimitive(element); | ||
64849 | } or | ||
64850 | { find mustInstanceOfFunctionalData_class(problem,interpretation,element); } | ||
64851 | /** | ||
64852 | * An element must be an instance of type "FunctionType enum". | ||
64853 | */ | ||
64854 | private pattern mustInstanceOfFunctionType_enum(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
64855 | Type.name(type,"FunctionType enum"); | ||
64856 | find directInstanceOf(problem,interpretation,element,type); | ||
64857 | } | ||
64858 | private pattern scopeDisallowsNewFunctionType_enum(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
64859 | find interpretation(problem,interpretation); | ||
64860 | PartialInterpretation.scopes(interpretation,scope); | ||
64861 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
64862 | Scope.maxNewElements(scope,0); | ||
64863 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
64864 | Type.name(type,"FunctionType enum"); | ||
64865 | } | ||
64866 | |||
64867 | /** | ||
64868 | * An element may be an instance of type "FunctionType enum". | ||
64869 | */ | ||
64870 | private pattern mayInstanceOfFunctionType_enum(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
64871 | { find mustInstanceOfFunctionType_enum(problem,interpretation,element); } | ||
64872 | |||
64873 | ////////// | ||
64874 | // 1.2 Relation Declaration Indexers | ||
64875 | ////////// | ||
64876 | /** | ||
64877 | * Matcher for detecting tuples t where []interface reference FunctionalElement(source,target) | ||
64878 | */ | ||
64879 | private pattern mustInRelationinterface_reference_FunctionalElement( | ||
64880 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
64881 | source: DefinedElement, target:DefinedElement) | ||
64882 | { | ||
64883 | find interpretation(problem,interpretation); | ||
64884 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
64885 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"interface reference FunctionalElement"); | ||
64886 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
64887 | BinaryElementRelationLink.param1(link,source); | ||
64888 | BinaryElementRelationLink.param2(link,target); | ||
64889 | } | ||
64890 | /** | ||
64891 | * Matcher for detecting tuples t where <>interface reference FunctionalElement(source,target) | ||
64892 | */ | ||
64893 | private pattern mayInRelationinterface_reference_FunctionalElement( | ||
64894 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
64895 | source: DefinedElement, target:DefinedElement) | ||
64896 | { | ||
64897 | find interpretation(problem,interpretation); | ||
64898 | // The two endpoint of the link have to exist | ||
64899 | find mayExist(problem, interpretation, source); | ||
64900 | find mayExist(problem, interpretation, target); | ||
64901 | // Type consistency | ||
64902 | find mayInstanceOfFunctionalElement_class(problem,interpretation,source); | ||
64903 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,target); | ||
64904 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
64905 | // the upper bound of the multiplicity should be considered. | ||
64906 | numberOfExistingReferences == count find mustInRelationinterface_reference_FunctionalElement(problem,interpretation,source,_); | ||
64907 | check(numberOfExistingReferences < 1); | ||
64908 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
64909 | // the upper bound of the opposite reference multiplicity should be considered. | ||
64910 | numberOfExistingOppositeReferences == count find mustInRelationelement_reference_FunctionalInterface(problem,interpretation,target,_); | ||
64911 | check(numberOfExistingOppositeReferences < 1); | ||
64912 | // The reference is containment, then a new reference cannot be create if: | ||
64913 | // 1. Multiple parents | ||
64914 | neg find mustContains4(problem,interpretation,_,target); | ||
64915 | // 2. Circle in the containment hierarchy | ||
64916 | neg find mustTransitiveContains(source,target); | ||
64917 | } or { | ||
64918 | find mustInRelationinterface_reference_FunctionalElement(problem,interpretation,source,target); | ||
64919 | } | ||
64920 | /** | ||
64921 | * Matcher for detecting tuples t where []model reference FunctionalElement(source,target) | ||
64922 | */ | ||
64923 | private pattern mustInRelationmodel_reference_FunctionalElement( | ||
64924 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
64925 | source: DefinedElement, target:DefinedElement) | ||
64926 | { | ||
64927 | find interpretation(problem,interpretation); | ||
64928 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
64929 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"model reference FunctionalElement"); | ||
64930 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
64931 | BinaryElementRelationLink.param1(link,source); | ||
64932 | BinaryElementRelationLink.param2(link,target); | ||
64933 | } | ||
64934 | /** | ||
64935 | * Matcher for detecting tuples t where <>model reference FunctionalElement(source,target) | ||
64936 | */ | ||
64937 | private pattern mayInRelationmodel_reference_FunctionalElement( | ||
64938 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
64939 | source: DefinedElement, target:DefinedElement) | ||
64940 | { | ||
64941 | find interpretation(problem,interpretation); | ||
64942 | // The two endpoint of the link have to exist | ||
64943 | find mayExist(problem, interpretation, source); | ||
64944 | find mayExist(problem, interpretation, target); | ||
64945 | // Type consistency | ||
64946 | find mayInstanceOfFunctionalElement_class(problem,interpretation,source); | ||
64947 | find mayInstanceOfFunctionalArchitectureModel_class(problem,interpretation,target); | ||
64948 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
64949 | // the upper bound of the multiplicity should be considered. | ||
64950 | numberOfExistingReferences == count find mustInRelationmodel_reference_FunctionalElement(problem,interpretation,source,_); | ||
64951 | check(numberOfExistingReferences < 1); | ||
64952 | } or { | ||
64953 | find mustInRelationmodel_reference_FunctionalElement(problem,interpretation,source,target); | ||
64954 | } | ||
64955 | /** | ||
64956 | * Matcher for detecting tuples t where []parent reference FunctionalElement(source,target) | ||
64957 | */ | ||
64958 | private pattern mustInRelationparent_reference_FunctionalElement( | ||
64959 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
64960 | source: DefinedElement, target:DefinedElement) | ||
64961 | { | ||
64962 | find interpretation(problem,interpretation); | ||
64963 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
64964 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"parent reference FunctionalElement"); | ||
64965 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
64966 | BinaryElementRelationLink.param1(link,source); | ||
64967 | BinaryElementRelationLink.param2(link,target); | ||
64968 | } | ||
64969 | /** | ||
64970 | * Matcher for detecting tuples t where <>parent reference FunctionalElement(source,target) | ||
64971 | */ | ||
64972 | private pattern mayInRelationparent_reference_FunctionalElement( | ||
64973 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
64974 | source: DefinedElement, target:DefinedElement) | ||
64975 | { | ||
64976 | find interpretation(problem,interpretation); | ||
64977 | // The two endpoint of the link have to exist | ||
64978 | find mayExist(problem, interpretation, source); | ||
64979 | find mayExist(problem, interpretation, target); | ||
64980 | // Type consistency | ||
64981 | find mayInstanceOfFunctionalElement_class(problem,interpretation,source); | ||
64982 | find mayInstanceOfFunction_class(problem,interpretation,target); | ||
64983 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
64984 | // the upper bound of the multiplicity should be considered. | ||
64985 | numberOfExistingReferences == count find mustInRelationparent_reference_FunctionalElement(problem,interpretation,source,_); | ||
64986 | check(numberOfExistingReferences < 1); | ||
64987 | // The eOpposite of the reference is containment, then a referene cannot be created if | ||
64988 | // 1. Multiple parents | ||
64989 | neg find mustContains4(problem,interpretation,source,_); | ||
64990 | // 2. Circle in the containment hierarchy | ||
64991 | neg find mustTransitiveContains(source,target); | ||
64992 | } or { | ||
64993 | find mustInRelationparent_reference_FunctionalElement(problem,interpretation,source,target); | ||
64994 | } | ||
64995 | /** | ||
64996 | * Matcher for detecting tuples t where []rootElements reference FunctionalArchitectureModel(source,target) | ||
64997 | */ | ||
64998 | private pattern mustInRelationrootElements_reference_FunctionalArchitectureModel( | ||
64999 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
65000 | source: DefinedElement, target:DefinedElement) | ||
65001 | { | ||
65002 | find interpretation(problem,interpretation); | ||
65003 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
65004 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"rootElements reference FunctionalArchitectureModel"); | ||
65005 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
65006 | BinaryElementRelationLink.param1(link,source); | ||
65007 | BinaryElementRelationLink.param2(link,target); | ||
65008 | } | ||
65009 | /** | ||
65010 | * Matcher for detecting tuples t where <>rootElements reference FunctionalArchitectureModel(source,target) | ||
65011 | */ | ||
65012 | private pattern mayInRelationrootElements_reference_FunctionalArchitectureModel( | ||
65013 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
65014 | source: DefinedElement, target:DefinedElement) | ||
65015 | { | ||
65016 | find interpretation(problem,interpretation); | ||
65017 | // The two endpoint of the link have to exist | ||
65018 | find mayExist(problem, interpretation, source); | ||
65019 | find mayExist(problem, interpretation, target); | ||
65020 | // Type consistency | ||
65021 | find mayInstanceOfFunctionalArchitectureModel_class(problem,interpretation,source); | ||
65022 | find mayInstanceOfFunctionalElement_class(problem,interpretation,target); | ||
65023 | // The reference is containment, then a new reference cannot be create if: | ||
65024 | // 1. Multiple parents | ||
65025 | neg find mustContains4(problem,interpretation,_,target); | ||
65026 | // 2. Circle in the containment hierarchy | ||
65027 | neg find mustTransitiveContains(source,target); | ||
65028 | } or { | ||
65029 | find mustInRelationrootElements_reference_FunctionalArchitectureModel(problem,interpretation,source,target); | ||
65030 | } | ||
65031 | /** | ||
65032 | * Matcher for detecting tuples t where []subElements reference Function(source,target) | ||
65033 | */ | ||
65034 | private pattern mustInRelationsubElements_reference_Function( | ||
65035 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
65036 | source: DefinedElement, target:DefinedElement) | ||
65037 | { | ||
65038 | find interpretation(problem,interpretation); | ||
65039 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
65040 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"subElements reference Function"); | ||
65041 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
65042 | BinaryElementRelationLink.param1(link,source); | ||
65043 | BinaryElementRelationLink.param2(link,target); | ||
65044 | } | ||
65045 | /** | ||
65046 | * Matcher for detecting tuples t where <>subElements reference Function(source,target) | ||
65047 | */ | ||
65048 | private pattern mayInRelationsubElements_reference_Function( | ||
65049 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
65050 | source: DefinedElement, target:DefinedElement) | ||
65051 | { | ||
65052 | find interpretation(problem,interpretation); | ||
65053 | // The two endpoint of the link have to exist | ||
65054 | find mayExist(problem, interpretation, source); | ||
65055 | find mayExist(problem, interpretation, target); | ||
65056 | // Type consistency | ||
65057 | find mayInstanceOfFunction_class(problem,interpretation,source); | ||
65058 | find mayInstanceOfFunctionalElement_class(problem,interpretation,target); | ||
65059 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
65060 | // the upper bound of the opposite reference multiplicity should be considered. | ||
65061 | numberOfExistingOppositeReferences == count find mustInRelationparent_reference_FunctionalElement(problem,interpretation,target,_); | ||
65062 | check(numberOfExistingOppositeReferences < 1); | ||
65063 | // The reference is containment, then a new reference cannot be create if: | ||
65064 | // 1. Multiple parents | ||
65065 | neg find mustContains4(problem,interpretation,_,target); | ||
65066 | // 2. Circle in the containment hierarchy | ||
65067 | neg find mustTransitiveContains(source,target); | ||
65068 | } or { | ||
65069 | find mustInRelationsubElements_reference_Function(problem,interpretation,source,target); | ||
65070 | } | ||
65071 | /** | ||
65072 | * Matcher for detecting tuples t where []data reference FAMTerminator(source,target) | ||
65073 | */ | ||
65074 | private pattern mustInRelationdata_reference_FAMTerminator( | ||
65075 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
65076 | source: DefinedElement, target:DefinedElement) | ||
65077 | { | ||
65078 | find interpretation(problem,interpretation); | ||
65079 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
65080 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"data reference FAMTerminator"); | ||
65081 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
65082 | BinaryElementRelationLink.param1(link,source); | ||
65083 | BinaryElementRelationLink.param2(link,target); | ||
65084 | } | ||
65085 | /** | ||
65086 | * Matcher for detecting tuples t where <>data reference FAMTerminator(source,target) | ||
65087 | */ | ||
65088 | private pattern mayInRelationdata_reference_FAMTerminator( | ||
65089 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
65090 | source: DefinedElement, target:DefinedElement) | ||
65091 | { | ||
65092 | find interpretation(problem,interpretation); | ||
65093 | // The two endpoint of the link have to exist | ||
65094 | find mayExist(problem, interpretation, source); | ||
65095 | find mayExist(problem, interpretation, target); | ||
65096 | // Type consistency | ||
65097 | find mayInstanceOfFAMTerminator_class(problem,interpretation,source); | ||
65098 | find mayInstanceOfFunctionalData_class(problem,interpretation,target); | ||
65099 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
65100 | // the upper bound of the multiplicity should be considered. | ||
65101 | numberOfExistingReferences == count find mustInRelationdata_reference_FAMTerminator(problem,interpretation,source,_); | ||
65102 | check(numberOfExistingReferences < 1); | ||
65103 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
65104 | // the upper bound of the opposite reference multiplicity should be considered. | ||
65105 | numberOfExistingOppositeReferences == count find mustInRelationterminator_reference_FunctionalData(problem,interpretation,target,_); | ||
65106 | check(numberOfExistingOppositeReferences < 1); | ||
65107 | // The eOpposite of the reference is containment, then a referene cannot be created if | ||
65108 | // 1. Multiple parents | ||
65109 | neg find mustContains4(problem,interpretation,source,_); | ||
65110 | // 2. Circle in the containment hierarchy | ||
65111 | neg find mustTransitiveContains(source,target); | ||
65112 | } or { | ||
65113 | find mustInRelationdata_reference_FAMTerminator(problem,interpretation,source,target); | ||
65114 | } | ||
65115 | /** | ||
65116 | * Matcher for detecting tuples t where []from reference InformationLink(source,target) | ||
65117 | */ | ||
65118 | private pattern mustInRelationfrom_reference_InformationLink( | ||
65119 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
65120 | source: DefinedElement, target:DefinedElement) | ||
65121 | { | ||
65122 | find interpretation(problem,interpretation); | ||
65123 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
65124 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"from reference InformationLink"); | ||
65125 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
65126 | BinaryElementRelationLink.param1(link,source); | ||
65127 | BinaryElementRelationLink.param2(link,target); | ||
65128 | } | ||
65129 | /** | ||
65130 | * Matcher for detecting tuples t where <>from reference InformationLink(source,target) | ||
65131 | */ | ||
65132 | private pattern mayInRelationfrom_reference_InformationLink( | ||
65133 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
65134 | source: DefinedElement, target:DefinedElement) | ||
65135 | { | ||
65136 | find interpretation(problem,interpretation); | ||
65137 | // The two endpoint of the link have to exist | ||
65138 | find mayExist(problem, interpretation, source); | ||
65139 | find mayExist(problem, interpretation, target); | ||
65140 | // Type consistency | ||
65141 | find mayInstanceOfInformationLink_class(problem,interpretation,source); | ||
65142 | find mayInstanceOfFunctionalOutput_class(problem,interpretation,target); | ||
65143 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
65144 | // the upper bound of the multiplicity should be considered. | ||
65145 | numberOfExistingReferences == count find mustInRelationfrom_reference_InformationLink(problem,interpretation,source,_); | ||
65146 | check(numberOfExistingReferences < 1); | ||
65147 | // The eOpposite of the reference is containment, then a referene cannot be created if | ||
65148 | // 1. Multiple parents | ||
65149 | neg find mustContains4(problem,interpretation,source,_); | ||
65150 | // 2. Circle in the containment hierarchy | ||
65151 | neg find mustTransitiveContains(source,target); | ||
65152 | } or { | ||
65153 | find mustInRelationfrom_reference_InformationLink(problem,interpretation,source,target); | ||
65154 | } | ||
65155 | /** | ||
65156 | * Matcher for detecting tuples t where []to reference InformationLink(source,target) | ||
65157 | */ | ||
65158 | private pattern mustInRelationto_reference_InformationLink( | ||
65159 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
65160 | source: DefinedElement, target:DefinedElement) | ||
65161 | { | ||
65162 | find interpretation(problem,interpretation); | ||
65163 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
65164 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"to reference InformationLink"); | ||
65165 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
65166 | BinaryElementRelationLink.param1(link,source); | ||
65167 | BinaryElementRelationLink.param2(link,target); | ||
65168 | } | ||
65169 | /** | ||
65170 | * Matcher for detecting tuples t where <>to reference InformationLink(source,target) | ||
65171 | */ | ||
65172 | private pattern mayInRelationto_reference_InformationLink( | ||
65173 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
65174 | source: DefinedElement, target:DefinedElement) | ||
65175 | { | ||
65176 | find interpretation(problem,interpretation); | ||
65177 | // The two endpoint of the link have to exist | ||
65178 | find mayExist(problem, interpretation, source); | ||
65179 | find mayExist(problem, interpretation, target); | ||
65180 | // Type consistency | ||
65181 | find mayInstanceOfInformationLink_class(problem,interpretation,source); | ||
65182 | find mayInstanceOfFunctionalInput_class(problem,interpretation,target); | ||
65183 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
65184 | // the upper bound of the multiplicity should be considered. | ||
65185 | numberOfExistingReferences == count find mustInRelationto_reference_InformationLink(problem,interpretation,source,_); | ||
65186 | check(numberOfExistingReferences < 1); | ||
65187 | } or { | ||
65188 | find mustInRelationto_reference_InformationLink(problem,interpretation,source,target); | ||
65189 | } | ||
65190 | /** | ||
65191 | * Matcher for detecting tuples t where []data reference FunctionalInterface(source,target) | ||
65192 | */ | ||
65193 | private pattern mustInRelationdata_reference_FunctionalInterface( | ||
65194 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
65195 | source: DefinedElement, target:DefinedElement) | ||
65196 | { | ||
65197 | find interpretation(problem,interpretation); | ||
65198 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
65199 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"data reference FunctionalInterface"); | ||
65200 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
65201 | BinaryElementRelationLink.param1(link,source); | ||
65202 | BinaryElementRelationLink.param2(link,target); | ||
65203 | } | ||
65204 | /** | ||
65205 | * Matcher for detecting tuples t where <>data reference FunctionalInterface(source,target) | ||
65206 | */ | ||
65207 | private pattern mayInRelationdata_reference_FunctionalInterface( | ||
65208 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
65209 | source: DefinedElement, target:DefinedElement) | ||
65210 | { | ||
65211 | find interpretation(problem,interpretation); | ||
65212 | // The two endpoint of the link have to exist | ||
65213 | find mayExist(problem, interpretation, source); | ||
65214 | find mayExist(problem, interpretation, target); | ||
65215 | // Type consistency | ||
65216 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,source); | ||
65217 | find mayInstanceOfFunctionalData_class(problem,interpretation,target); | ||
65218 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
65219 | // the upper bound of the opposite reference multiplicity should be considered. | ||
65220 | numberOfExistingOppositeReferences == count find mustInRelationinterface_reference_FunctionalData(problem,interpretation,target,_); | ||
65221 | check(numberOfExistingOppositeReferences < 1); | ||
65222 | // The reference is containment, then a new reference cannot be create if: | ||
65223 | // 1. Multiple parents | ||
65224 | neg find mustContains4(problem,interpretation,_,target); | ||
65225 | // 2. Circle in the containment hierarchy | ||
65226 | neg find mustTransitiveContains(source,target); | ||
65227 | } or { | ||
65228 | find mustInRelationdata_reference_FunctionalInterface(problem,interpretation,source,target); | ||
65229 | } | ||
65230 | /** | ||
65231 | * Matcher for detecting tuples t where []element reference FunctionalInterface(source,target) | ||
65232 | */ | ||
65233 | private pattern mustInRelationelement_reference_FunctionalInterface( | ||
65234 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
65235 | source: DefinedElement, target:DefinedElement) | ||
65236 | { | ||
65237 | find interpretation(problem,interpretation); | ||
65238 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
65239 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"element reference FunctionalInterface"); | ||
65240 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
65241 | BinaryElementRelationLink.param1(link,source); | ||
65242 | BinaryElementRelationLink.param2(link,target); | ||
65243 | } | ||
65244 | /** | ||
65245 | * Matcher for detecting tuples t where <>element reference FunctionalInterface(source,target) | ||
65246 | */ | ||
65247 | private pattern mayInRelationelement_reference_FunctionalInterface( | ||
65248 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
65249 | source: DefinedElement, target:DefinedElement) | ||
65250 | { | ||
65251 | find interpretation(problem,interpretation); | ||
65252 | // The two endpoint of the link have to exist | ||
65253 | find mayExist(problem, interpretation, source); | ||
65254 | find mayExist(problem, interpretation, target); | ||
65255 | // Type consistency | ||
65256 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,source); | ||
65257 | find mayInstanceOfFunctionalElement_class(problem,interpretation,target); | ||
65258 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
65259 | // the upper bound of the multiplicity should be considered. | ||
65260 | numberOfExistingReferences == count find mustInRelationelement_reference_FunctionalInterface(problem,interpretation,source,_); | ||
65261 | check(numberOfExistingReferences < 1); | ||
65262 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
65263 | // the upper bound of the opposite reference multiplicity should be considered. | ||
65264 | numberOfExistingOppositeReferences == count find mustInRelationinterface_reference_FunctionalElement(problem,interpretation,target,_); | ||
65265 | check(numberOfExistingOppositeReferences < 1); | ||
65266 | // The eOpposite of the reference is containment, then a referene cannot be created if | ||
65267 | // 1. Multiple parents | ||
65268 | neg find mustContains4(problem,interpretation,source,_); | ||
65269 | // 2. Circle in the containment hierarchy | ||
65270 | neg find mustTransitiveContains(source,target); | ||
65271 | } or { | ||
65272 | find mustInRelationelement_reference_FunctionalInterface(problem,interpretation,source,target); | ||
65273 | } | ||
65274 | /** | ||
65275 | * Matcher for detecting tuples t where []IncomingLinks reference FunctionalInput(source,target) | ||
65276 | */ | ||
65277 | private pattern mustInRelationIncomingLinks_reference_FunctionalInput( | ||
65278 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
65279 | source: DefinedElement, target:DefinedElement) | ||
65280 | { | ||
65281 | find interpretation(problem,interpretation); | ||
65282 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
65283 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"IncomingLinks reference FunctionalInput"); | ||
65284 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
65285 | BinaryElementRelationLink.param1(link,source); | ||
65286 | BinaryElementRelationLink.param2(link,target); | ||
65287 | } | ||
65288 | /** | ||
65289 | * Matcher for detecting tuples t where <>IncomingLinks reference FunctionalInput(source,target) | ||
65290 | */ | ||
65291 | private pattern mayInRelationIncomingLinks_reference_FunctionalInput( | ||
65292 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
65293 | source: DefinedElement, target:DefinedElement) | ||
65294 | { | ||
65295 | find interpretation(problem,interpretation); | ||
65296 | // The two endpoint of the link have to exist | ||
65297 | find mayExist(problem, interpretation, source); | ||
65298 | find mayExist(problem, interpretation, target); | ||
65299 | // Type consistency | ||
65300 | find mayInstanceOfFunctionalInput_class(problem,interpretation,source); | ||
65301 | find mayInstanceOfInformationLink_class(problem,interpretation,target); | ||
65302 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
65303 | // the upper bound of the opposite reference multiplicity should be considered. | ||
65304 | numberOfExistingOppositeReferences == count find mustInRelationto_reference_InformationLink(problem,interpretation,target,_); | ||
65305 | check(numberOfExistingOppositeReferences < 1); | ||
65306 | } or { | ||
65307 | find mustInRelationIncomingLinks_reference_FunctionalInput(problem,interpretation,source,target); | ||
65308 | } | ||
65309 | /** | ||
65310 | * Matcher for detecting tuples t where []outgoingLinks reference FunctionalOutput(source,target) | ||
65311 | */ | ||
65312 | private pattern mustInRelationoutgoingLinks_reference_FunctionalOutput( | ||
65313 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
65314 | source: DefinedElement, target:DefinedElement) | ||
65315 | { | ||
65316 | find interpretation(problem,interpretation); | ||
65317 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
65318 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"outgoingLinks reference FunctionalOutput"); | ||
65319 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
65320 | BinaryElementRelationLink.param1(link,source); | ||
65321 | BinaryElementRelationLink.param2(link,target); | ||
65322 | } | ||
65323 | /** | ||
65324 | * Matcher for detecting tuples t where <>outgoingLinks reference FunctionalOutput(source,target) | ||
65325 | */ | ||
65326 | private pattern mayInRelationoutgoingLinks_reference_FunctionalOutput( | ||
65327 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
65328 | source: DefinedElement, target:DefinedElement) | ||
65329 | { | ||
65330 | find interpretation(problem,interpretation); | ||
65331 | // The two endpoint of the link have to exist | ||
65332 | find mayExist(problem, interpretation, source); | ||
65333 | find mayExist(problem, interpretation, target); | ||
65334 | // Type consistency | ||
65335 | find mayInstanceOfFunctionalOutput_class(problem,interpretation,source); | ||
65336 | find mayInstanceOfInformationLink_class(problem,interpretation,target); | ||
65337 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
65338 | // the upper bound of the opposite reference multiplicity should be considered. | ||
65339 | numberOfExistingOppositeReferences == count find mustInRelationfrom_reference_InformationLink(problem,interpretation,target,_); | ||
65340 | check(numberOfExistingOppositeReferences < 1); | ||
65341 | // The reference is containment, then a new reference cannot be create if: | ||
65342 | // 1. Multiple parents | ||
65343 | neg find mustContains4(problem,interpretation,_,target); | ||
65344 | // 2. Circle in the containment hierarchy | ||
65345 | neg find mustTransitiveContains(source,target); | ||
65346 | } or { | ||
65347 | find mustInRelationoutgoingLinks_reference_FunctionalOutput(problem,interpretation,source,target); | ||
65348 | } | ||
65349 | /** | ||
65350 | * Matcher for detecting tuples t where []terminator reference FunctionalData(source,target) | ||
65351 | */ | ||
65352 | private pattern mustInRelationterminator_reference_FunctionalData( | ||
65353 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
65354 | source: DefinedElement, target:DefinedElement) | ||
65355 | { | ||
65356 | find interpretation(problem,interpretation); | ||
65357 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
65358 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"terminator reference FunctionalData"); | ||
65359 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
65360 | BinaryElementRelationLink.param1(link,source); | ||
65361 | BinaryElementRelationLink.param2(link,target); | ||
65362 | } | ||
65363 | /** | ||
65364 | * Matcher for detecting tuples t where <>terminator reference FunctionalData(source,target) | ||
65365 | */ | ||
65366 | private pattern mayInRelationterminator_reference_FunctionalData( | ||
65367 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
65368 | source: DefinedElement, target:DefinedElement) | ||
65369 | { | ||
65370 | find interpretation(problem,interpretation); | ||
65371 | // The two endpoint of the link have to exist | ||
65372 | find mayExist(problem, interpretation, source); | ||
65373 | find mayExist(problem, interpretation, target); | ||
65374 | // Type consistency | ||
65375 | find mayInstanceOfFunctionalData_class(problem,interpretation,source); | ||
65376 | find mayInstanceOfFAMTerminator_class(problem,interpretation,target); | ||
65377 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
65378 | // the upper bound of the multiplicity should be considered. | ||
65379 | numberOfExistingReferences == count find mustInRelationterminator_reference_FunctionalData(problem,interpretation,source,_); | ||
65380 | check(numberOfExistingReferences < 1); | ||
65381 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
65382 | // the upper bound of the opposite reference multiplicity should be considered. | ||
65383 | numberOfExistingOppositeReferences == count find mustInRelationdata_reference_FAMTerminator(problem,interpretation,target,_); | ||
65384 | check(numberOfExistingOppositeReferences < 1); | ||
65385 | // The reference is containment, then a new reference cannot be create if: | ||
65386 | // 1. Multiple parents | ||
65387 | neg find mustContains4(problem,interpretation,_,target); | ||
65388 | // 2. Circle in the containment hierarchy | ||
65389 | neg find mustTransitiveContains(source,target); | ||
65390 | } or { | ||
65391 | find mustInRelationterminator_reference_FunctionalData(problem,interpretation,source,target); | ||
65392 | } | ||
65393 | /** | ||
65394 | * Matcher for detecting tuples t where []interface reference FunctionalData(source,target) | ||
65395 | */ | ||
65396 | private pattern mustInRelationinterface_reference_FunctionalData( | ||
65397 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
65398 | source: DefinedElement, target:DefinedElement) | ||
65399 | { | ||
65400 | find interpretation(problem,interpretation); | ||
65401 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
65402 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"interface reference FunctionalData"); | ||
65403 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
65404 | BinaryElementRelationLink.param1(link,source); | ||
65405 | BinaryElementRelationLink.param2(link,target); | ||
65406 | } | ||
65407 | /** | ||
65408 | * Matcher for detecting tuples t where <>interface reference FunctionalData(source,target) | ||
65409 | */ | ||
65410 | private pattern mayInRelationinterface_reference_FunctionalData( | ||
65411 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
65412 | source: DefinedElement, target:DefinedElement) | ||
65413 | { | ||
65414 | find interpretation(problem,interpretation); | ||
65415 | // The two endpoint of the link have to exist | ||
65416 | find mayExist(problem, interpretation, source); | ||
65417 | find mayExist(problem, interpretation, target); | ||
65418 | // Type consistency | ||
65419 | find mayInstanceOfFunctionalData_class(problem,interpretation,source); | ||
65420 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,target); | ||
65421 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
65422 | // the upper bound of the multiplicity should be considered. | ||
65423 | numberOfExistingReferences == count find mustInRelationinterface_reference_FunctionalData(problem,interpretation,source,_); | ||
65424 | check(numberOfExistingReferences < 1); | ||
65425 | // The eOpposite of the reference is containment, then a referene cannot be created if | ||
65426 | // 1. Multiple parents | ||
65427 | neg find mustContains4(problem,interpretation,source,_); | ||
65428 | // 2. Circle in the containment hierarchy | ||
65429 | neg find mustTransitiveContains(source,target); | ||
65430 | } or { | ||
65431 | find mustInRelationinterface_reference_FunctionalData(problem,interpretation,source,target); | ||
65432 | } | ||
65433 | /** | ||
65434 | * Matcher for detecting tuples t where []type attribute Function(source,target) | ||
65435 | */ | ||
65436 | private pattern mustInRelationtype_attribute_Function( | ||
65437 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
65438 | source: DefinedElement, target:DefinedElement) | ||
65439 | { | ||
65440 | find interpretation(problem,interpretation); | ||
65441 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
65442 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"type attribute Function"); | ||
65443 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
65444 | BinaryElementRelationLink.param1(link,source); | ||
65445 | BinaryElementRelationLink.param2(link,target); | ||
65446 | } | ||
65447 | /** | ||
65448 | * Matcher for detecting tuples t where <>type attribute Function(source,target) | ||
65449 | */ | ||
65450 | private pattern mayInRelationtype_attribute_Function( | ||
65451 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
65452 | source: DefinedElement, target:DefinedElement) | ||
65453 | { | ||
65454 | find interpretation(problem,interpretation); | ||
65455 | // The two endpoint of the link have to exist | ||
65456 | find mayExist(problem, interpretation, source); | ||
65457 | find mayExist(problem, interpretation, target); | ||
65458 | // Type consistency | ||
65459 | find mayInstanceOfFunction_class(problem,interpretation,source); | ||
65460 | find mayInstanceOfFunctionType_enum(problem,interpretation,target); | ||
65461 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
65462 | // the upper bound of the multiplicity should be considered. | ||
65463 | numberOfExistingReferences == count find mustInRelationtype_attribute_Function(problem,interpretation,source,_); | ||
65464 | check(numberOfExistingReferences < 1); | ||
65465 | } or { | ||
65466 | find mustInRelationtype_attribute_Function(problem,interpretation,source,target); | ||
65467 | } | ||
65468 | |||
65469 | ////////// | ||
65470 | // 1.3 Relation Definition Indexers | ||
65471 | ////////// | ||
65472 | |||
65473 | ////////// | ||
65474 | // 1.4 Containment Indexer | ||
65475 | ////////// | ||
65476 | private pattern mustContains2(source: DefinedElement, target: DefinedElement) { | ||
65477 | find mustContains4(_,_,source,target); | ||
65478 | } | ||
65479 | |||
65480 | private pattern mustContains4(problem:LogicProblem, interpretation:PartialInterpretation, | ||
65481 | source: DefinedElement, target: DefinedElement) | ||
65482 | { find mustInRelationinterface_reference_FunctionalElement(problem,interpretation,source,target); }or | ||
65483 | |||
65484 | { find mustInRelationrootElements_reference_FunctionalArchitectureModel(problem,interpretation,source,target); }or | ||
65485 | |||
65486 | { find mustInRelationsubElements_reference_Function(problem,interpretation,source,target); }or | ||
65487 | |||
65488 | { find mustInRelationdata_reference_FunctionalInterface(problem,interpretation,source,target); }or | ||
65489 | |||
65490 | { find mustInRelationoutgoingLinks_reference_FunctionalOutput(problem,interpretation,source,target); }or | ||
65491 | |||
65492 | { find mustInRelationterminator_reference_FunctionalData(problem,interpretation,source,target); } | ||
65493 | |||
65494 | private pattern mustTransitiveContains(source,target) { | ||
65495 | find mustContains2+(source,target); | ||
65496 | } | ||
65497 | |||
65498 | ////////// | ||
65499 | // 2. Invalidation Indexers | ||
65500 | ////////// | ||
65501 | // 2.1 Invalidated by WF Queries | ||
65502 | ////////// | ||
65503 | |||
65504 | ////////// | ||
65505 | // 3. Unfinishedness Indexers | ||
65506 | ////////// | ||
65507 | // 3.1 Unfinishedness Measured by Multiplicity | ||
65508 | ////////// | ||
65509 | pattern unfinishedLowerMultiplicity_model_reference_FunctionalElement(problem:LogicProblem, interpretation:PartialInterpretation, relationIterpretation:PartialRelationInterpretation, object:DefinedElement,missingMultiplicity) { | ||
65510 | find interpretation(problem,interpretation); | ||
65511 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
65512 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"model reference FunctionalElement"); | ||
65513 | find mustInstanceOfFunctionalElement_class(problem,interpretation,object); | ||
65514 | numberOfExistingReferences == count find mustInRelationmodel_reference_FunctionalElement(problem,interpretation,object,_); | ||
65515 | check(numberOfExistingReferences < 1); | ||
65516 | missingMultiplicity == eval(1-numberOfExistingReferences); | ||
65517 | } | ||
65518 | pattern unfinishedLowerMultiplicity_to_reference_InformationLink(problem:LogicProblem, interpretation:PartialInterpretation, relationIterpretation:PartialRelationInterpretation, object:DefinedElement,missingMultiplicity) { | ||
65519 | find interpretation(problem,interpretation); | ||
65520 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
65521 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"to reference InformationLink"); | ||
65522 | find mustInstanceOfInformationLink_class(problem,interpretation,object); | ||
65523 | numberOfExistingReferences == count find mustInRelationto_reference_InformationLink(problem,interpretation,object,_); | ||
65524 | check(numberOfExistingReferences < 1); | ||
65525 | missingMultiplicity == eval(1-numberOfExistingReferences); | ||
65526 | } | ||
65527 | pattern unfinishedLowerMultiplicity_type_attribute_Function(problem:LogicProblem, interpretation:PartialInterpretation, relationIterpretation:PartialRelationInterpretation, object:DefinedElement,missingMultiplicity) { | ||
65528 | find interpretation(problem,interpretation); | ||
65529 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
65530 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"type attribute Function"); | ||
65531 | find mustInstanceOfFunction_class(problem,interpretation,object); | ||
65532 | numberOfExistingReferences == count find mustInRelationtype_attribute_Function(problem,interpretation,object,_); | ||
65533 | check(numberOfExistingReferences < 1); | ||
65534 | missingMultiplicity == eval(1-numberOfExistingReferences); | ||
65535 | } | ||
65536 | |||
65537 | ////////// | ||
65538 | // 3.2 Unfinishedness Measured by WF Queries | ||
65539 | ////////// | ||
65540 | |||
65541 | ////////// | ||
65542 | // 4. Refinement Indexers | ||
65543 | ////////// | ||
65544 | // 4.1 Object constructors | ||
65545 | ////////// | ||
65546 | private pattern hasElementInContainment(problem:LogicProblem, interpretation:PartialInterpretation) | ||
65547 | { | ||
65548 | find interpretation(problem,interpretation); | ||
65549 | find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,root); | ||
65550 | find mustExist(problem, interpretation, root); | ||
65551 | }or{ | ||
65552 | find interpretation(problem,interpretation); | ||
65553 | find mustInstanceOfFunctionalInput_class(problem,interpretation,root); | ||
65554 | find mustExist(problem, interpretation, root); | ||
65555 | }or{ | ||
65556 | find interpretation(problem,interpretation); | ||
65557 | find mustInstanceOfFunctionalOutput_class(problem,interpretation,root); | ||
65558 | find mustExist(problem, interpretation, root); | ||
65559 | }or{ | ||
65560 | find interpretation(problem,interpretation); | ||
65561 | find mustInstanceOfFAMTerminator_class(problem,interpretation,root); | ||
65562 | find mustExist(problem, interpretation, root); | ||
65563 | }or{ | ||
65564 | find interpretation(problem,interpretation); | ||
65565 | find mustInstanceOfFunctionalInterface_class(problem,interpretation,root); | ||
65566 | find mustExist(problem, interpretation, root); | ||
65567 | }or{ | ||
65568 | find interpretation(problem,interpretation); | ||
65569 | find mustInstanceOfFunction_class(problem,interpretation,root); | ||
65570 | find mustExist(problem, interpretation, root); | ||
65571 | }or{ | ||
65572 | find interpretation(problem,interpretation); | ||
65573 | find mustInstanceOfInformationLink_class(problem,interpretation,root); | ||
65574 | find mustExist(problem, interpretation, root); | ||
65575 | }or{ | ||
65576 | find interpretation(problem,interpretation); | ||
65577 | find mustInstanceOfFunctionalElement_class(problem,interpretation,root); | ||
65578 | find mustExist(problem, interpretation, root); | ||
65579 | }or{ | ||
65580 | find interpretation(problem,interpretation); | ||
65581 | find mustInstanceOfFunctionalData_class(problem,interpretation,root); | ||
65582 | find mustExist(problem, interpretation, root); | ||
65583 | } | ||
65584 | pattern createObject_Function_class_by_rootElements_reference_FunctionalArchitectureModel( | ||
65585 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
65586 | relationInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
65587 | container:DefinedElement) | ||
65588 | { | ||
65589 | find interpretation(problem,interpretation); | ||
65590 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
65591 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"Function class"); | ||
65592 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
65593 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"rootElements reference FunctionalArchitectureModel"); | ||
65594 | find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,container); | ||
65595 | find mayInstanceOfFunction_class(problem,interpretation,newObject); | ||
65596 | find mayInRelationrootElements_reference_FunctionalArchitectureModel(problem,interpretation,container,newObject); | ||
65597 | find mustExist(problem, interpretation, container); | ||
65598 | neg find mustExist(problem, interpretation, newObject); | ||
65599 | } | ||
65600 | pattern createObject_Function_class_by_subElements_reference_Function_with_parent_reference_FunctionalElement( | ||
65601 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
65602 | relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
65603 | container:DefinedElement) | ||
65604 | { | ||
65605 | find interpretation(problem,interpretation); | ||
65606 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
65607 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"Function class"); | ||
65608 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
65609 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"subElements reference Function"); | ||
65610 | PartialInterpretation.partialrelationinterpretation(interpretation,inverseInterpretation); | ||
65611 | PartialRelationInterpretation.interpretationOf.name(inverseInterpretation,"parent reference FunctionalElement"); | ||
65612 | find mustInstanceOfFunction_class(problem,interpretation,container); | ||
65613 | find mayInstanceOfFunction_class(problem,interpretation,newObject); | ||
65614 | find mayInRelationsubElements_reference_Function(problem,interpretation,container,newObject); | ||
65615 | find mustExist(problem, interpretation, container); | ||
65616 | neg find mustExist(problem, interpretation, newObject); | ||
65617 | } | ||
65618 | pattern createObject_Function_class( | ||
65619 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
65620 | typeInterpretation:PartialComplexTypeInterpretation) | ||
65621 | { | ||
65622 | find interpretation(problem,interpretation); | ||
65623 | neg find hasElementInContainment(problem,interpretation); | ||
65624 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
65625 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"Function class"); | ||
65626 | find mayInstanceOfFunction_class(problem,interpretation,newObject); | ||
65627 | find mayExist(problem, interpretation, newObject); | ||
65628 | neg find mustExist(problem, interpretation, newObject); | ||
65629 | } | ||
65630 | pattern createObject_FunctionalOutput_class_by_data_reference_FunctionalInterface_with_interface_reference_FunctionalData( | ||
65631 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
65632 | relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
65633 | container:DefinedElement) | ||
65634 | { | ||
65635 | find interpretation(problem,interpretation); | ||
65636 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
65637 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalOutput class"); | ||
65638 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
65639 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"data reference FunctionalInterface"); | ||
65640 | PartialInterpretation.partialrelationinterpretation(interpretation,inverseInterpretation); | ||
65641 | PartialRelationInterpretation.interpretationOf.name(inverseInterpretation,"interface reference FunctionalData"); | ||
65642 | find mustInstanceOfFunctionalInterface_class(problem,interpretation,container); | ||
65643 | find mayInstanceOfFunctionalOutput_class(problem,interpretation,newObject); | ||
65644 | find mayInRelationdata_reference_FunctionalInterface(problem,interpretation,container,newObject); | ||
65645 | find mustExist(problem, interpretation, container); | ||
65646 | neg find mustExist(problem, interpretation, newObject); | ||
65647 | } | ||
65648 | pattern createObject_FunctionalOutput_class( | ||
65649 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
65650 | typeInterpretation:PartialComplexTypeInterpretation) | ||
65651 | { | ||
65652 | find interpretation(problem,interpretation); | ||
65653 | neg find hasElementInContainment(problem,interpretation); | ||
65654 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
65655 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalOutput class"); | ||
65656 | find mayInstanceOfFunctionalOutput_class(problem,interpretation,newObject); | ||
65657 | find mayExist(problem, interpretation, newObject); | ||
65658 | neg find mustExist(problem, interpretation, newObject); | ||
65659 | } | ||
65660 | pattern createObject_FunctionalInterface_class_by_interface_reference_FunctionalElement_with_element_reference_FunctionalInterface( | ||
65661 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
65662 | relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
65663 | container:DefinedElement) | ||
65664 | { | ||
65665 | find interpretation(problem,interpretation); | ||
65666 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
65667 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalInterface class"); | ||
65668 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
65669 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"interface reference FunctionalElement"); | ||
65670 | PartialInterpretation.partialrelationinterpretation(interpretation,inverseInterpretation); | ||
65671 | PartialRelationInterpretation.interpretationOf.name(inverseInterpretation,"element reference FunctionalInterface"); | ||
65672 | find mustInstanceOfFunctionalElement_class(problem,interpretation,container); | ||
65673 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,newObject); | ||
65674 | find mayInRelationinterface_reference_FunctionalElement(problem,interpretation,container,newObject); | ||
65675 | find mustExist(problem, interpretation, container); | ||
65676 | neg find mustExist(problem, interpretation, newObject); | ||
65677 | } | ||
65678 | pattern createObject_FunctionalInterface_class( | ||
65679 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
65680 | typeInterpretation:PartialComplexTypeInterpretation) | ||
65681 | { | ||
65682 | find interpretation(problem,interpretation); | ||
65683 | neg find hasElementInContainment(problem,interpretation); | ||
65684 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
65685 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalInterface class"); | ||
65686 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,newObject); | ||
65687 | find mayExist(problem, interpretation, newObject); | ||
65688 | neg find mustExist(problem, interpretation, newObject); | ||
65689 | } | ||
65690 | pattern createObject_FunctionalArchitectureModel_class( | ||
65691 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
65692 | typeInterpretation:PartialComplexTypeInterpretation) | ||
65693 | { | ||
65694 | find interpretation(problem,interpretation); | ||
65695 | neg find hasElementInContainment(problem,interpretation); | ||
65696 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
65697 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalArchitectureModel class"); | ||
65698 | find mayInstanceOfFunctionalArchitectureModel_class(problem,interpretation,newObject); | ||
65699 | find mayExist(problem, interpretation, newObject); | ||
65700 | neg find mustExist(problem, interpretation, newObject); | ||
65701 | } | ||
65702 | pattern createObject_FunctionalInput_class_by_data_reference_FunctionalInterface_with_interface_reference_FunctionalData( | ||
65703 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
65704 | relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
65705 | container:DefinedElement) | ||
65706 | { | ||
65707 | find interpretation(problem,interpretation); | ||
65708 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
65709 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalInput class"); | ||
65710 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
65711 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"data reference FunctionalInterface"); | ||
65712 | PartialInterpretation.partialrelationinterpretation(interpretation,inverseInterpretation); | ||
65713 | PartialRelationInterpretation.interpretationOf.name(inverseInterpretation,"interface reference FunctionalData"); | ||
65714 | find mustInstanceOfFunctionalInterface_class(problem,interpretation,container); | ||
65715 | find mayInstanceOfFunctionalInput_class(problem,interpretation,newObject); | ||
65716 | find mayInRelationdata_reference_FunctionalInterface(problem,interpretation,container,newObject); | ||
65717 | find mustExist(problem, interpretation, container); | ||
65718 | neg find mustExist(problem, interpretation, newObject); | ||
65719 | } | ||
65720 | pattern createObject_FunctionalInput_class( | ||
65721 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
65722 | typeInterpretation:PartialComplexTypeInterpretation) | ||
65723 | { | ||
65724 | find interpretation(problem,interpretation); | ||
65725 | neg find hasElementInContainment(problem,interpretation); | ||
65726 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
65727 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalInput class"); | ||
65728 | find mayInstanceOfFunctionalInput_class(problem,interpretation,newObject); | ||
65729 | find mayExist(problem, interpretation, newObject); | ||
65730 | neg find mustExist(problem, interpretation, newObject); | ||
65731 | } | ||
65732 | pattern createObject_FAMTerminator_class_by_terminator_reference_FunctionalData_with_data_reference_FAMTerminator( | ||
65733 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
65734 | relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
65735 | container:DefinedElement) | ||
65736 | { | ||
65737 | find interpretation(problem,interpretation); | ||
65738 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
65739 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FAMTerminator class"); | ||
65740 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
65741 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"terminator reference FunctionalData"); | ||
65742 | PartialInterpretation.partialrelationinterpretation(interpretation,inverseInterpretation); | ||
65743 | PartialRelationInterpretation.interpretationOf.name(inverseInterpretation,"data reference FAMTerminator"); | ||
65744 | find mustInstanceOfFunctionalData_class(problem,interpretation,container); | ||
65745 | find mayInstanceOfFAMTerminator_class(problem,interpretation,newObject); | ||
65746 | find mayInRelationterminator_reference_FunctionalData(problem,interpretation,container,newObject); | ||
65747 | find mustExist(problem, interpretation, container); | ||
65748 | neg find mustExist(problem, interpretation, newObject); | ||
65749 | } | ||
65750 | pattern createObject_FAMTerminator_class( | ||
65751 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
65752 | typeInterpretation:PartialComplexTypeInterpretation) | ||
65753 | { | ||
65754 | find interpretation(problem,interpretation); | ||
65755 | neg find hasElementInContainment(problem,interpretation); | ||
65756 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
65757 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FAMTerminator class"); | ||
65758 | find mayInstanceOfFAMTerminator_class(problem,interpretation,newObject); | ||
65759 | find mayExist(problem, interpretation, newObject); | ||
65760 | neg find mustExist(problem, interpretation, newObject); | ||
65761 | } | ||
65762 | pattern createObject_InformationLink_class_by_outgoingLinks_reference_FunctionalOutput_with_from_reference_InformationLink( | ||
65763 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
65764 | relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
65765 | container:DefinedElement) | ||
65766 | { | ||
65767 | find interpretation(problem,interpretation); | ||
65768 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
65769 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"InformationLink class"); | ||
65770 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
65771 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"outgoingLinks reference FunctionalOutput"); | ||
65772 | PartialInterpretation.partialrelationinterpretation(interpretation,inverseInterpretation); | ||
65773 | PartialRelationInterpretation.interpretationOf.name(inverseInterpretation,"from reference InformationLink"); | ||
65774 | find mustInstanceOfFunctionalOutput_class(problem,interpretation,container); | ||
65775 | find mayInstanceOfInformationLink_class(problem,interpretation,newObject); | ||
65776 | find mayInRelationoutgoingLinks_reference_FunctionalOutput(problem,interpretation,container,newObject); | ||
65777 | find mustExist(problem, interpretation, container); | ||
65778 | neg find mustExist(problem, interpretation, newObject); | ||
65779 | } | ||
65780 | pattern createObject_InformationLink_class( | ||
65781 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
65782 | typeInterpretation:PartialComplexTypeInterpretation) | ||
65783 | { | ||
65784 | find interpretation(problem,interpretation); | ||
65785 | neg find hasElementInContainment(problem,interpretation); | ||
65786 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
65787 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"InformationLink class"); | ||
65788 | find mayInstanceOfInformationLink_class(problem,interpretation,newObject); | ||
65789 | find mayExist(problem, interpretation, newObject); | ||
65790 | neg find mustExist(problem, interpretation, newObject); | ||
65791 | } | ||
65792 | |||
65793 | ////////// | ||
65794 | // 4.2 Type refinement | ||
65795 | ////////// | ||
65796 | pattern refineTypeTo_Function_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
65797 | find interpretation(problem,interpretation); | ||
65798 | PartialInterpretation.newElements(interpretation,element); | ||
65799 | find mayInstanceOfFunction_class(problem,interpretation,element); | ||
65800 | neg find mustInstanceOfFunction_class(problem,interpretation,element); | ||
65801 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
65802 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
65803 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
65804 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
65805 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
65806 | } | ||
65807 | pattern refineTypeTo_FunctionalOutput_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
65808 | find interpretation(problem,interpretation); | ||
65809 | PartialInterpretation.newElements(interpretation,element); | ||
65810 | find mayInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
65811 | neg find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
65812 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
65813 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
65814 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
65815 | neg find mustInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
65816 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
65817 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
65818 | } | ||
65819 | pattern refineTypeTo_FunctionalInterface_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
65820 | find interpretation(problem,interpretation); | ||
65821 | PartialInterpretation.newElements(interpretation,element); | ||
65822 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
65823 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
65824 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
65825 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
65826 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
65827 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
65828 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
65829 | } | ||
65830 | pattern refineTypeTo_FunctionalArchitectureModel_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
65831 | find interpretation(problem,interpretation); | ||
65832 | PartialInterpretation.newElements(interpretation,element); | ||
65833 | find mayInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
65834 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
65835 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
65836 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
65837 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
65838 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
65839 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
65840 | } | ||
65841 | pattern refineTypeTo_FunctionalInput_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
65842 | find interpretation(problem,interpretation); | ||
65843 | PartialInterpretation.newElements(interpretation,element); | ||
65844 | find mayInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
65845 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
65846 | neg find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
65847 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
65848 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
65849 | neg find mustInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
65850 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
65851 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
65852 | } | ||
65853 | pattern refineTypeTo_FAMTerminator_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
65854 | find interpretation(problem,interpretation); | ||
65855 | PartialInterpretation.newElements(interpretation,element); | ||
65856 | find mayInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
65857 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
65858 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
65859 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
65860 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
65861 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
65862 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
65863 | } | ||
65864 | pattern refineTypeTo_InformationLink_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
65865 | find interpretation(problem,interpretation); | ||
65866 | PartialInterpretation.newElements(interpretation,element); | ||
65867 | find mayInstanceOfInformationLink_class(problem,interpretation,element); | ||
65868 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
65869 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
65870 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
65871 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
65872 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
65873 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
65874 | } | ||
65875 | |||
65876 | ////////// | ||
65877 | // 4.3 Relation refinement | ||
65878 | ////////// | ||
65879 | pattern refineRelation_model_reference_FunctionalElement( | ||
65880 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
65881 | relationIterpretation:PartialRelationInterpretation, | ||
65882 | from: DefinedElement, to: DefinedElement) | ||
65883 | { | ||
65884 | find interpretation(problem,interpretation); | ||
65885 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
65886 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"model reference FunctionalElement"); | ||
65887 | find mustExist(problem, interpretation, from); | ||
65888 | find mustExist(problem, interpretation, to); | ||
65889 | find mustInstanceOfFunctionalElement_class(problem,interpretation,from); | ||
65890 | find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,to); | ||
65891 | find mayInRelationmodel_reference_FunctionalElement(problem,interpretation,from,to); | ||
65892 | neg find mustInRelationmodel_reference_FunctionalElement(problem,interpretation,from,to); | ||
65893 | } | ||
65894 | pattern refineRelation_IncomingLinks_reference_FunctionalInput_and_to_reference_InformationLink( | ||
65895 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
65896 | relationIterpretation:PartialRelationInterpretation, oppositeInterpretation:PartialRelationInterpretation, | ||
65897 | from: DefinedElement, to: DefinedElement) | ||
65898 | { | ||
65899 | find interpretation(problem,interpretation); | ||
65900 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
65901 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"IncomingLinks reference FunctionalInput"); | ||
65902 | PartialInterpretation.partialrelationinterpretation(interpretation,oppositeInterpretation); | ||
65903 | PartialRelationInterpretation.interpretationOf.name(oppositeInterpretation,"to reference InformationLink"); | ||
65904 | find mustExist(problem, interpretation, from); | ||
65905 | find mustExist(problem, interpretation, to); | ||
65906 | find mustInstanceOfFunctionalInput_class(problem,interpretation,from); | ||
65907 | find mustInstanceOfInformationLink_class(problem,interpretation,to); | ||
65908 | find mayInRelationIncomingLinks_reference_FunctionalInput(problem,interpretation,from,to); | ||
65909 | neg find mustInRelationIncomingLinks_reference_FunctionalInput(problem,interpretation,from,to); | ||
65910 | } | ||
65911 | pattern refineRelation_type_attribute_Function( | ||
65912 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
65913 | relationIterpretation:PartialRelationInterpretation, | ||
65914 | from: DefinedElement, to: DefinedElement) | ||
65915 | { | ||
65916 | find interpretation(problem,interpretation); | ||
65917 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
65918 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"type attribute Function"); | ||
65919 | find mustExist(problem, interpretation, from); | ||
65920 | find mustExist(problem, interpretation, to); | ||
65921 | find mustInstanceOfFunction_class(problem,interpretation,from); | ||
65922 | find mustInstanceOfFunctionType_enum(problem,interpretation,to); | ||
65923 | find mayInRelationtype_attribute_Function(problem,interpretation,from,to); | ||
65924 | neg find mustInRelationtype_attribute_Function(problem,interpretation,from,to); | ||
65925 | } | ||
65926 | import epackage "http://www.bme.hu/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage" | ||
65927 | import epackage "http://www.bme.hu/mit/inf/dslreasoner/logic/model/problem" | ||
65928 | import epackage "http://www.bme.hu/mit/inf/dslreasoner/logic/model/language" | ||
65929 | |||
65930 | ////////// | ||
65931 | // 0. Util | ||
65932 | ////////// | ||
65933 | private pattern interpretation(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
65934 | PartialInterpretation.problem(interpretation,problem); | ||
65935 | } | ||
65936 | |||
65937 | ///////////////////////// | ||
65938 | // 0.1 Existence | ||
65939 | ///////////////////////// | ||
65940 | private pattern mustExist(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
65941 | find interpretation(problem,interpretation); | ||
65942 | LogicProblem.elements(problem,element); | ||
65943 | } or { | ||
65944 | find interpretation(problem,interpretation); | ||
65945 | PartialInterpretation.newElements(interpretation,element); | ||
65946 | } | ||
65947 | |||
65948 | private pattern mayExist(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
65949 | find mustExist(problem,interpretation,element); | ||
65950 | } or { | ||
65951 | find interpretation(problem,interpretation); | ||
65952 | neg find elementCloseWorld(element); | ||
65953 | PartialInterpretation.openWorldElements(interpretation,element); | ||
65954 | } | ||
65955 | |||
65956 | private pattern elementCloseWorld(element:DefinedElement) { | ||
65957 | PartialInterpretation.openWorldElements(i,element); | ||
65958 | PartialInterpretation.maxNewElements(i,0); | ||
65959 | } or { | ||
65960 | Scope.targetTypeInterpretation(scope,interpretation); | ||
65961 | PartialTypeInterpratation.elements(interpretation,element); | ||
65962 | Scope.maxNewElements(scope,0); | ||
65963 | } | ||
65964 | |||
65965 | //////////////////////// | ||
65966 | // 0.2 Equivalence | ||
65967 | //////////////////////// | ||
65968 | pattern mayEquivalent(problem:LogicProblem, interpretation:PartialInterpretation, a: DefinedElement, b: DefinedElement) { | ||
65969 | find mayExist(problem,interpretation,a); | ||
65970 | find mayExist(problem,interpretation,b); | ||
65971 | a == b; | ||
65972 | } | ||
65973 | |||
65974 | //////////////////////// | ||
65975 | // 0.3 Required Patterns by TypeIndexer | ||
65976 | //////////////////////// | ||
65977 | private pattern typeInterpretation(problem:LogicProblem, interpretation:PartialInterpretation, type:TypeDeclaration, typeInterpretation:PartialComplexTypeInterpretation) { | ||
65978 | find interpretation(problem,interpretation); | ||
65979 | LogicProblem.types(problem,type); | ||
65980 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
65981 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
65982 | } | ||
65983 | |||
65984 | private pattern directInstanceOf(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement, type:Type) { | ||
65985 | find interpretation(problem,interpretation); | ||
65986 | LogicProblem.types(problem,type); | ||
65987 | TypeDefinition.elements(type,element); | ||
65988 | } or { | ||
65989 | find interpretation(problem,interpretation); | ||
65990 | find typeInterpretation(problem,interpretation,type,typeInterpretation); | ||
65991 | PartialComplexTypeInterpretation.elements(typeInterpretation,element); | ||
65992 | } | ||
65993 | |||
65994 | private pattern isPrimitive(element: PrimitiveElement) { | ||
65995 | PrimitiveElement(element); | ||
65996 | } | ||
65997 | |||
65998 | ////////// | ||
65999 | // 1. Problem-Specific Base Indexers | ||
66000 | ////////// | ||
66001 | // 1.1 Type Indexers | ||
66002 | ////////// | ||
66003 | // 1.1.1 primitive Type Indexers | ||
66004 | ////////// | ||
66005 | |||
66006 | ////////// | ||
66007 | // 1.1.2 domain-specific Type Indexers | ||
66008 | ////////// | ||
66009 | /** | ||
66010 | * An element must be an instance of type "FunctionalElement class". | ||
66011 | */ | ||
66012 | private pattern mustInstanceOfFunctionalElement_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
66013 | Type.name(type,"FunctionalElement class"); | ||
66014 | find directInstanceOf(problem,interpretation,element,type); | ||
66015 | } | ||
66016 | private pattern scopeDisallowsNewFunctionalElement_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
66017 | find interpretation(problem,interpretation); | ||
66018 | PartialInterpretation.scopes(interpretation,scope); | ||
66019 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
66020 | Scope.maxNewElements(scope,0); | ||
66021 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
66022 | Type.name(type,"FunctionalElement class"); | ||
66023 | } | ||
66024 | |||
66025 | /** | ||
66026 | * An element may be an instance of type "FunctionalElement class". | ||
66027 | */ | ||
66028 | private pattern mayInstanceOfFunctionalElement_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
66029 | { | ||
66030 | find interpretation(problem,interpretation); | ||
66031 | PartialInterpretation.newElements(interpretation,element); | ||
66032 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
66033 | neg find mustInstanceOfFunction_class(problem,interpretation,element); | ||
66034 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
66035 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
66036 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
66037 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
66038 | neg find scopeDisallowsNewFunctionalElement_class(problem, interpretation); | ||
66039 | neg find isPrimitive(element); | ||
66040 | } or { | ||
66041 | find interpretation(problem,interpretation); | ||
66042 | PartialInterpretation.openWorldElements(interpretation,element); | ||
66043 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
66044 | neg find mustInstanceOfFunction_class(problem,interpretation,element); | ||
66045 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
66046 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
66047 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
66048 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
66049 | neg find scopeDisallowsNewFunctionalElement_class(problem, interpretation); | ||
66050 | neg find isPrimitive(element); | ||
66051 | } or | ||
66052 | { find mustInstanceOfFunctionalElement_class(problem,interpretation,element); } | ||
66053 | /** | ||
66054 | * An element must be an instance of type "FunctionalArchitectureModel class". | ||
66055 | */ | ||
66056 | private pattern mustInstanceOfFunctionalArchitectureModel_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
66057 | Type.name(type,"FunctionalArchitectureModel class"); | ||
66058 | find directInstanceOf(problem,interpretation,element,type); | ||
66059 | } | ||
66060 | private pattern scopeDisallowsNewFunctionalArchitectureModel_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
66061 | find interpretation(problem,interpretation); | ||
66062 | PartialInterpretation.scopes(interpretation,scope); | ||
66063 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
66064 | Scope.maxNewElements(scope,0); | ||
66065 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
66066 | Type.name(type,"FunctionalArchitectureModel class"); | ||
66067 | } | ||
66068 | |||
66069 | /** | ||
66070 | * An element may be an instance of type "FunctionalArchitectureModel class". | ||
66071 | */ | ||
66072 | private pattern mayInstanceOfFunctionalArchitectureModel_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
66073 | { | ||
66074 | find interpretation(problem,interpretation); | ||
66075 | PartialInterpretation.newElements(interpretation,element); | ||
66076 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
66077 | neg find mustInstanceOfFunctionalArchitectureModel_class_UndefinedPart(problem,interpretation,element); | ||
66078 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
66079 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
66080 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
66081 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
66082 | neg find scopeDisallowsNewFunctionalArchitectureModel_class(problem, interpretation); | ||
66083 | neg find isPrimitive(element); | ||
66084 | } or { | ||
66085 | find interpretation(problem,interpretation); | ||
66086 | PartialInterpretation.openWorldElements(interpretation,element); | ||
66087 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
66088 | neg find mustInstanceOfFunctionalArchitectureModel_class_UndefinedPart(problem,interpretation,element); | ||
66089 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
66090 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
66091 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
66092 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
66093 | neg find scopeDisallowsNewFunctionalArchitectureModel_class(problem, interpretation); | ||
66094 | neg find isPrimitive(element); | ||
66095 | } or | ||
66096 | { find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); } | ||
66097 | /** | ||
66098 | * An element must be an instance of type "Function class". | ||
66099 | */ | ||
66100 | private pattern mustInstanceOfFunction_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
66101 | Type.name(type,"Function class"); | ||
66102 | find directInstanceOf(problem,interpretation,element,type); | ||
66103 | } | ||
66104 | private pattern scopeDisallowsNewFunction_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
66105 | find interpretation(problem,interpretation); | ||
66106 | PartialInterpretation.scopes(interpretation,scope); | ||
66107 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
66108 | Scope.maxNewElements(scope,0); | ||
66109 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
66110 | Type.name(type,"Function class"); | ||
66111 | } | ||
66112 | |||
66113 | /** | ||
66114 | * An element may be an instance of type "Function class". | ||
66115 | */ | ||
66116 | private pattern mayInstanceOfFunction_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
66117 | { | ||
66118 | find interpretation(problem,interpretation); | ||
66119 | PartialInterpretation.newElements(interpretation,element); | ||
66120 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
66121 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
66122 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
66123 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
66124 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
66125 | neg find scopeDisallowsNewFunction_class(problem, interpretation); | ||
66126 | neg find isPrimitive(element); | ||
66127 | } or { | ||
66128 | find interpretation(problem,interpretation); | ||
66129 | PartialInterpretation.openWorldElements(interpretation,element); | ||
66130 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
66131 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
66132 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
66133 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
66134 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
66135 | neg find scopeDisallowsNewFunction_class(problem, interpretation); | ||
66136 | neg find isPrimitive(element); | ||
66137 | } or | ||
66138 | { find mustInstanceOfFunction_class(problem,interpretation,element); } | ||
66139 | /** | ||
66140 | * An element must be an instance of type "FAMTerminator class". | ||
66141 | */ | ||
66142 | private pattern mustInstanceOfFAMTerminator_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
66143 | Type.name(type,"FAMTerminator class"); | ||
66144 | find directInstanceOf(problem,interpretation,element,type); | ||
66145 | } | ||
66146 | private pattern scopeDisallowsNewFAMTerminator_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
66147 | find interpretation(problem,interpretation); | ||
66148 | PartialInterpretation.scopes(interpretation,scope); | ||
66149 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
66150 | Scope.maxNewElements(scope,0); | ||
66151 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
66152 | Type.name(type,"FAMTerminator class"); | ||
66153 | } | ||
66154 | |||
66155 | /** | ||
66156 | * An element may be an instance of type "FAMTerminator class". | ||
66157 | */ | ||
66158 | private pattern mayInstanceOfFAMTerminator_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
66159 | { | ||
66160 | find interpretation(problem,interpretation); | ||
66161 | PartialInterpretation.newElements(interpretation,element); | ||
66162 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
66163 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
66164 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
66165 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
66166 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
66167 | neg find scopeDisallowsNewFAMTerminator_class(problem, interpretation); | ||
66168 | neg find isPrimitive(element); | ||
66169 | } or { | ||
66170 | find interpretation(problem,interpretation); | ||
66171 | PartialInterpretation.openWorldElements(interpretation,element); | ||
66172 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
66173 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
66174 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
66175 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
66176 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
66177 | neg find scopeDisallowsNewFAMTerminator_class(problem, interpretation); | ||
66178 | neg find isPrimitive(element); | ||
66179 | } or | ||
66180 | { find mustInstanceOfFAMTerminator_class(problem,interpretation,element); } | ||
66181 | /** | ||
66182 | * An element must be an instance of type "InformationLink class". | ||
66183 | */ | ||
66184 | private pattern mustInstanceOfInformationLink_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
66185 | Type.name(type,"InformationLink class"); | ||
66186 | find directInstanceOf(problem,interpretation,element,type); | ||
66187 | } | ||
66188 | private pattern scopeDisallowsNewInformationLink_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
66189 | find interpretation(problem,interpretation); | ||
66190 | PartialInterpretation.scopes(interpretation,scope); | ||
66191 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
66192 | Scope.maxNewElements(scope,0); | ||
66193 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
66194 | Type.name(type,"InformationLink class"); | ||
66195 | } | ||
66196 | |||
66197 | /** | ||
66198 | * An element may be an instance of type "InformationLink class". | ||
66199 | */ | ||
66200 | private pattern mayInstanceOfInformationLink_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
66201 | { | ||
66202 | find interpretation(problem,interpretation); | ||
66203 | PartialInterpretation.newElements(interpretation,element); | ||
66204 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
66205 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
66206 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
66207 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
66208 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
66209 | neg find scopeDisallowsNewInformationLink_class(problem, interpretation); | ||
66210 | neg find isPrimitive(element); | ||
66211 | } or { | ||
66212 | find interpretation(problem,interpretation); | ||
66213 | PartialInterpretation.openWorldElements(interpretation,element); | ||
66214 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
66215 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
66216 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
66217 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
66218 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
66219 | neg find scopeDisallowsNewInformationLink_class(problem, interpretation); | ||
66220 | neg find isPrimitive(element); | ||
66221 | } or | ||
66222 | { find mustInstanceOfInformationLink_class(problem,interpretation,element); } | ||
66223 | /** | ||
66224 | * An element must be an instance of type "FunctionalInterface class". | ||
66225 | */ | ||
66226 | private pattern mustInstanceOfFunctionalInterface_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
66227 | Type.name(type,"FunctionalInterface class"); | ||
66228 | find directInstanceOf(problem,interpretation,element,type); | ||
66229 | } | ||
66230 | private pattern scopeDisallowsNewFunctionalInterface_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
66231 | find interpretation(problem,interpretation); | ||
66232 | PartialInterpretation.scopes(interpretation,scope); | ||
66233 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
66234 | Scope.maxNewElements(scope,0); | ||
66235 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
66236 | Type.name(type,"FunctionalInterface class"); | ||
66237 | } | ||
66238 | |||
66239 | /** | ||
66240 | * An element may be an instance of type "FunctionalInterface class". | ||
66241 | */ | ||
66242 | private pattern mayInstanceOfFunctionalInterface_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
66243 | { | ||
66244 | find interpretation(problem,interpretation); | ||
66245 | PartialInterpretation.newElements(interpretation,element); | ||
66246 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
66247 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
66248 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
66249 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
66250 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
66251 | neg find scopeDisallowsNewFunctionalInterface_class(problem, interpretation); | ||
66252 | neg find isPrimitive(element); | ||
66253 | } or { | ||
66254 | find interpretation(problem,interpretation); | ||
66255 | PartialInterpretation.openWorldElements(interpretation,element); | ||
66256 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
66257 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
66258 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
66259 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
66260 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
66261 | neg find scopeDisallowsNewFunctionalInterface_class(problem, interpretation); | ||
66262 | neg find isPrimitive(element); | ||
66263 | } or | ||
66264 | { find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); } | ||
66265 | /** | ||
66266 | * An element must be an instance of type "FunctionalInput class". | ||
66267 | */ | ||
66268 | private pattern mustInstanceOfFunctionalInput_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
66269 | Type.name(type,"FunctionalInput class"); | ||
66270 | find directInstanceOf(problem,interpretation,element,type); | ||
66271 | } | ||
66272 | private pattern scopeDisallowsNewFunctionalInput_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
66273 | find interpretation(problem,interpretation); | ||
66274 | PartialInterpretation.scopes(interpretation,scope); | ||
66275 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
66276 | Scope.maxNewElements(scope,0); | ||
66277 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
66278 | Type.name(type,"FunctionalInput class"); | ||
66279 | } | ||
66280 | |||
66281 | /** | ||
66282 | * An element may be an instance of type "FunctionalInput class". | ||
66283 | */ | ||
66284 | private pattern mayInstanceOfFunctionalInput_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
66285 | { | ||
66286 | find interpretation(problem,interpretation); | ||
66287 | PartialInterpretation.newElements(interpretation,element); | ||
66288 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
66289 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
66290 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
66291 | neg find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
66292 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
66293 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
66294 | neg find scopeDisallowsNewFunctionalInput_class(problem, interpretation); | ||
66295 | neg find isPrimitive(element); | ||
66296 | } or { | ||
66297 | find interpretation(problem,interpretation); | ||
66298 | PartialInterpretation.openWorldElements(interpretation,element); | ||
66299 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
66300 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
66301 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
66302 | neg find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
66303 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
66304 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
66305 | neg find scopeDisallowsNewFunctionalInput_class(problem, interpretation); | ||
66306 | neg find isPrimitive(element); | ||
66307 | } or | ||
66308 | { find mustInstanceOfFunctionalInput_class(problem,interpretation,element); } | ||
66309 | /** | ||
66310 | * An element must be an instance of type "FunctionalOutput class". | ||
66311 | */ | ||
66312 | private pattern mustInstanceOfFunctionalOutput_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
66313 | Type.name(type,"FunctionalOutput class"); | ||
66314 | find directInstanceOf(problem,interpretation,element,type); | ||
66315 | } | ||
66316 | private pattern scopeDisallowsNewFunctionalOutput_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
66317 | find interpretation(problem,interpretation); | ||
66318 | PartialInterpretation.scopes(interpretation,scope); | ||
66319 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
66320 | Scope.maxNewElements(scope,0); | ||
66321 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
66322 | Type.name(type,"FunctionalOutput class"); | ||
66323 | } | ||
66324 | |||
66325 | /** | ||
66326 | * An element may be an instance of type "FunctionalOutput class". | ||
66327 | */ | ||
66328 | private pattern mayInstanceOfFunctionalOutput_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
66329 | { | ||
66330 | find interpretation(problem,interpretation); | ||
66331 | PartialInterpretation.newElements(interpretation,element); | ||
66332 | neg find mustInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
66333 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
66334 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
66335 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
66336 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
66337 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
66338 | neg find scopeDisallowsNewFunctionalOutput_class(problem, interpretation); | ||
66339 | neg find isPrimitive(element); | ||
66340 | } or { | ||
66341 | find interpretation(problem,interpretation); | ||
66342 | PartialInterpretation.openWorldElements(interpretation,element); | ||
66343 | neg find mustInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
66344 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
66345 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
66346 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
66347 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
66348 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
66349 | neg find scopeDisallowsNewFunctionalOutput_class(problem, interpretation); | ||
66350 | neg find isPrimitive(element); | ||
66351 | } or | ||
66352 | { find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); } | ||
66353 | /** | ||
66354 | * An element must be an instance of type "FunctionalData class". | ||
66355 | */ | ||
66356 | private pattern mustInstanceOfFunctionalData_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
66357 | Type.name(type,"FunctionalData class"); | ||
66358 | find directInstanceOf(problem,interpretation,element,type); | ||
66359 | } | ||
66360 | private pattern scopeDisallowsNewFunctionalData_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
66361 | find interpretation(problem,interpretation); | ||
66362 | PartialInterpretation.scopes(interpretation,scope); | ||
66363 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
66364 | Scope.maxNewElements(scope,0); | ||
66365 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
66366 | Type.name(type,"FunctionalData class"); | ||
66367 | } | ||
66368 | |||
66369 | /** | ||
66370 | * An element may be an instance of type "FunctionalData class". | ||
66371 | */ | ||
66372 | private pattern mayInstanceOfFunctionalData_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
66373 | { | ||
66374 | find interpretation(problem,interpretation); | ||
66375 | PartialInterpretation.newElements(interpretation,element); | ||
66376 | neg find mustInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
66377 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
66378 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
66379 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
66380 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
66381 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
66382 | neg find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
66383 | neg find scopeDisallowsNewFunctionalData_class(problem, interpretation); | ||
66384 | neg find isPrimitive(element); | ||
66385 | } or { | ||
66386 | find interpretation(problem,interpretation); | ||
66387 | PartialInterpretation.openWorldElements(interpretation,element); | ||
66388 | neg find mustInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
66389 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
66390 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
66391 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
66392 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
66393 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
66394 | neg find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
66395 | neg find scopeDisallowsNewFunctionalData_class(problem, interpretation); | ||
66396 | neg find isPrimitive(element); | ||
66397 | } or | ||
66398 | { find mustInstanceOfFunctionalData_class(problem,interpretation,element); } | ||
66399 | /** | ||
66400 | * An element must be an instance of type "FunctionType enum". | ||
66401 | */ | ||
66402 | private pattern mustInstanceOfFunctionType_enum(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
66403 | Type.name(type,"FunctionType enum"); | ||
66404 | find directInstanceOf(problem,interpretation,element,type); | ||
66405 | } | ||
66406 | private pattern scopeDisallowsNewFunctionType_enum(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
66407 | find interpretation(problem,interpretation); | ||
66408 | PartialInterpretation.scopes(interpretation,scope); | ||
66409 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
66410 | Scope.maxNewElements(scope,0); | ||
66411 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
66412 | Type.name(type,"FunctionType enum"); | ||
66413 | } | ||
66414 | |||
66415 | /** | ||
66416 | * An element may be an instance of type "FunctionType enum". | ||
66417 | */ | ||
66418 | private pattern mayInstanceOfFunctionType_enum(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
66419 | { find mustInstanceOfFunctionType_enum(problem,interpretation,element); } | ||
66420 | /** | ||
66421 | * An element must be an instance of type "FunctionalArchitectureModel class DefinedPart". | ||
66422 | */ | ||
66423 | private pattern mustInstanceOfFunctionalArchitectureModel_class_DefinedPart(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
66424 | Type.name(type,"FunctionalArchitectureModel class DefinedPart"); | ||
66425 | find directInstanceOf(problem,interpretation,element,type); | ||
66426 | } | ||
66427 | private pattern scopeDisallowsNewFunctionalArchitectureModel_class_DefinedPart(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
66428 | find interpretation(problem,interpretation); | ||
66429 | PartialInterpretation.scopes(interpretation,scope); | ||
66430 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
66431 | Scope.maxNewElements(scope,0); | ||
66432 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
66433 | Type.name(type,"FunctionalArchitectureModel class DefinedPart"); | ||
66434 | } | ||
66435 | |||
66436 | /** | ||
66437 | * An element may be an instance of type "FunctionalArchitectureModel class DefinedPart". | ||
66438 | */ | ||
66439 | private pattern mayInstanceOfFunctionalArchitectureModel_class_DefinedPart(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
66440 | { find mustInstanceOfFunctionalArchitectureModel_class_DefinedPart(problem,interpretation,element); } | ||
66441 | /** | ||
66442 | * An element must be an instance of type "FunctionalArchitectureModel class UndefinedPart". | ||
66443 | */ | ||
66444 | private pattern mustInstanceOfFunctionalArchitectureModel_class_UndefinedPart(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
66445 | Type.name(type,"FunctionalArchitectureModel class UndefinedPart"); | ||
66446 | find directInstanceOf(problem,interpretation,element,type); | ||
66447 | } | ||
66448 | private pattern scopeDisallowsNewFunctionalArchitectureModel_class_UndefinedPart(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
66449 | find interpretation(problem,interpretation); | ||
66450 | PartialInterpretation.scopes(interpretation,scope); | ||
66451 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
66452 | Scope.maxNewElements(scope,0); | ||
66453 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
66454 | Type.name(type,"FunctionalArchitectureModel class UndefinedPart"); | ||
66455 | } | ||
66456 | |||
66457 | /** | ||
66458 | * An element may be an instance of type "FunctionalArchitectureModel class UndefinedPart". | ||
66459 | */ | ||
66460 | private pattern mayInstanceOfFunctionalArchitectureModel_class_UndefinedPart(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
66461 | { | ||
66462 | find interpretation(problem,interpretation); | ||
66463 | PartialInterpretation.newElements(interpretation,element); | ||
66464 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
66465 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
66466 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
66467 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
66468 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
66469 | neg find scopeDisallowsNewFunctionalArchitectureModel_class_UndefinedPart(problem, interpretation); | ||
66470 | neg find isPrimitive(element); | ||
66471 | } or { | ||
66472 | find interpretation(problem,interpretation); | ||
66473 | PartialInterpretation.openWorldElements(interpretation,element); | ||
66474 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
66475 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
66476 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
66477 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
66478 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
66479 | neg find scopeDisallowsNewFunctionalArchitectureModel_class_UndefinedPart(problem, interpretation); | ||
66480 | neg find isPrimitive(element); | ||
66481 | } or | ||
66482 | { find mustInstanceOfFunctionalArchitectureModel_class_UndefinedPart(problem,interpretation,element); } | ||
66483 | |||
66484 | ////////// | ||
66485 | // 1.2 Relation Declaration Indexers | ||
66486 | ////////// | ||
66487 | /** | ||
66488 | * Matcher for detecting tuples t where []interface reference FunctionalElement(source,target) | ||
66489 | */ | ||
66490 | private pattern mustInRelationinterface_reference_FunctionalElement( | ||
66491 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
66492 | source: DefinedElement, target:DefinedElement) | ||
66493 | { | ||
66494 | find interpretation(problem,interpretation); | ||
66495 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
66496 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"interface reference FunctionalElement"); | ||
66497 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
66498 | BinaryElementRelationLink.param1(link,source); | ||
66499 | BinaryElementRelationLink.param2(link,target); | ||
66500 | } | ||
66501 | /** | ||
66502 | * Matcher for detecting tuples t where <>interface reference FunctionalElement(source,target) | ||
66503 | */ | ||
66504 | private pattern mayInRelationinterface_reference_FunctionalElement( | ||
66505 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
66506 | source: DefinedElement, target:DefinedElement) | ||
66507 | { | ||
66508 | find interpretation(problem,interpretation); | ||
66509 | // The two endpoint of the link have to exist | ||
66510 | find mayExist(problem, interpretation, source); | ||
66511 | find mayExist(problem, interpretation, target); | ||
66512 | // Type consistency | ||
66513 | find mayInstanceOfFunctionalElement_class(problem,interpretation,source); | ||
66514 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,target); | ||
66515 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
66516 | // the upper bound of the multiplicity should be considered. | ||
66517 | numberOfExistingReferences == count find mustInRelationinterface_reference_FunctionalElement(problem,interpretation,source,_); | ||
66518 | check(numberOfExistingReferences < 1); | ||
66519 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
66520 | // the upper bound of the opposite reference multiplicity should be considered. | ||
66521 | numberOfExistingOppositeReferences == count find mustInRelationelement_reference_FunctionalInterface(problem,interpretation,target,_); | ||
66522 | check(numberOfExistingOppositeReferences < 1); | ||
66523 | // The reference is containment, then a new reference cannot be create if: | ||
66524 | // 1. Multiple parents | ||
66525 | neg find mustContains4(problem,interpretation,_,target); | ||
66526 | // 2. Circle in the containment hierarchy | ||
66527 | neg find mustTransitiveContains(source,target); | ||
66528 | } or { | ||
66529 | find mustInRelationinterface_reference_FunctionalElement(problem,interpretation,source,target); | ||
66530 | } | ||
66531 | /** | ||
66532 | * Matcher for detecting tuples t where []model reference FunctionalElement(source,target) | ||
66533 | */ | ||
66534 | private pattern mustInRelationmodel_reference_FunctionalElement( | ||
66535 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
66536 | source: DefinedElement, target:DefinedElement) | ||
66537 | { | ||
66538 | find interpretation(problem,interpretation); | ||
66539 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
66540 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"model reference FunctionalElement"); | ||
66541 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
66542 | BinaryElementRelationLink.param1(link,source); | ||
66543 | BinaryElementRelationLink.param2(link,target); | ||
66544 | } | ||
66545 | /** | ||
66546 | * Matcher for detecting tuples t where <>model reference FunctionalElement(source,target) | ||
66547 | */ | ||
66548 | private pattern mayInRelationmodel_reference_FunctionalElement( | ||
66549 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
66550 | source: DefinedElement, target:DefinedElement) | ||
66551 | { | ||
66552 | find interpretation(problem,interpretation); | ||
66553 | // The two endpoint of the link have to exist | ||
66554 | find mayExist(problem, interpretation, source); | ||
66555 | find mayExist(problem, interpretation, target); | ||
66556 | // Type consistency | ||
66557 | find mayInstanceOfFunctionalElement_class(problem,interpretation,source); | ||
66558 | find mayInstanceOfFunctionalArchitectureModel_class(problem,interpretation,target); | ||
66559 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
66560 | // the upper bound of the multiplicity should be considered. | ||
66561 | numberOfExistingReferences == count find mustInRelationmodel_reference_FunctionalElement(problem,interpretation,source,_); | ||
66562 | check(numberOfExistingReferences < 1); | ||
66563 | } or { | ||
66564 | find mustInRelationmodel_reference_FunctionalElement(problem,interpretation,source,target); | ||
66565 | } | ||
66566 | /** | ||
66567 | * Matcher for detecting tuples t where []parent reference FunctionalElement(source,target) | ||
66568 | */ | ||
66569 | private pattern mustInRelationparent_reference_FunctionalElement( | ||
66570 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
66571 | source: DefinedElement, target:DefinedElement) | ||
66572 | { | ||
66573 | find interpretation(problem,interpretation); | ||
66574 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
66575 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"parent reference FunctionalElement"); | ||
66576 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
66577 | BinaryElementRelationLink.param1(link,source); | ||
66578 | BinaryElementRelationLink.param2(link,target); | ||
66579 | } | ||
66580 | /** | ||
66581 | * Matcher for detecting tuples t where <>parent reference FunctionalElement(source,target) | ||
66582 | */ | ||
66583 | private pattern mayInRelationparent_reference_FunctionalElement( | ||
66584 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
66585 | source: DefinedElement, target:DefinedElement) | ||
66586 | { | ||
66587 | find interpretation(problem,interpretation); | ||
66588 | // The two endpoint of the link have to exist | ||
66589 | find mayExist(problem, interpretation, source); | ||
66590 | find mayExist(problem, interpretation, target); | ||
66591 | // Type consistency | ||
66592 | find mayInstanceOfFunctionalElement_class(problem,interpretation,source); | ||
66593 | find mayInstanceOfFunction_class(problem,interpretation,target); | ||
66594 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
66595 | // the upper bound of the multiplicity should be considered. | ||
66596 | numberOfExistingReferences == count find mustInRelationparent_reference_FunctionalElement(problem,interpretation,source,_); | ||
66597 | check(numberOfExistingReferences < 1); | ||
66598 | // The eOpposite of the reference is containment, then a referene cannot be created if | ||
66599 | // 1. Multiple parents | ||
66600 | neg find mustContains4(problem,interpretation,source,_); | ||
66601 | // 2. Circle in the containment hierarchy | ||
66602 | neg find mustTransitiveContains(source,target); | ||
66603 | } or { | ||
66604 | find mustInRelationparent_reference_FunctionalElement(problem,interpretation,source,target); | ||
66605 | } | ||
66606 | /** | ||
66607 | * Matcher for detecting tuples t where []rootElements reference FunctionalArchitectureModel(source,target) | ||
66608 | */ | ||
66609 | private pattern mustInRelationrootElements_reference_FunctionalArchitectureModel( | ||
66610 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
66611 | source: DefinedElement, target:DefinedElement) | ||
66612 | { | ||
66613 | find interpretation(problem,interpretation); | ||
66614 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
66615 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"rootElements reference FunctionalArchitectureModel"); | ||
66616 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
66617 | BinaryElementRelationLink.param1(link,source); | ||
66618 | BinaryElementRelationLink.param2(link,target); | ||
66619 | } | ||
66620 | /** | ||
66621 | * Matcher for detecting tuples t where <>rootElements reference FunctionalArchitectureModel(source,target) | ||
66622 | */ | ||
66623 | private pattern mayInRelationrootElements_reference_FunctionalArchitectureModel( | ||
66624 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
66625 | source: DefinedElement, target:DefinedElement) | ||
66626 | { | ||
66627 | find interpretation(problem,interpretation); | ||
66628 | // The two endpoint of the link have to exist | ||
66629 | find mayExist(problem, interpretation, source); | ||
66630 | find mayExist(problem, interpretation, target); | ||
66631 | // Type consistency | ||
66632 | find mayInstanceOfFunctionalArchitectureModel_class(problem,interpretation,source); | ||
66633 | find mayInstanceOfFunctionalElement_class(problem,interpretation,target); | ||
66634 | // The reference is containment, then a new reference cannot be create if: | ||
66635 | // 1. Multiple parents | ||
66636 | neg find mustContains4(problem,interpretation,_,target); | ||
66637 | // 2. Circle in the containment hierarchy | ||
66638 | neg find mustTransitiveContains(source,target); | ||
66639 | } or { | ||
66640 | find mustInRelationrootElements_reference_FunctionalArchitectureModel(problem,interpretation,source,target); | ||
66641 | } | ||
66642 | /** | ||
66643 | * Matcher for detecting tuples t where []subElements reference Function(source,target) | ||
66644 | */ | ||
66645 | private pattern mustInRelationsubElements_reference_Function( | ||
66646 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
66647 | source: DefinedElement, target:DefinedElement) | ||
66648 | { | ||
66649 | find interpretation(problem,interpretation); | ||
66650 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
66651 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"subElements reference Function"); | ||
66652 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
66653 | BinaryElementRelationLink.param1(link,source); | ||
66654 | BinaryElementRelationLink.param2(link,target); | ||
66655 | } | ||
66656 | /** | ||
66657 | * Matcher for detecting tuples t where <>subElements reference Function(source,target) | ||
66658 | */ | ||
66659 | private pattern mayInRelationsubElements_reference_Function( | ||
66660 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
66661 | source: DefinedElement, target:DefinedElement) | ||
66662 | { | ||
66663 | find interpretation(problem,interpretation); | ||
66664 | // The two endpoint of the link have to exist | ||
66665 | find mayExist(problem, interpretation, source); | ||
66666 | find mayExist(problem, interpretation, target); | ||
66667 | // Type consistency | ||
66668 | find mayInstanceOfFunction_class(problem,interpretation,source); | ||
66669 | find mayInstanceOfFunctionalElement_class(problem,interpretation,target); | ||
66670 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
66671 | // the upper bound of the opposite reference multiplicity should be considered. | ||
66672 | numberOfExistingOppositeReferences == count find mustInRelationparent_reference_FunctionalElement(problem,interpretation,target,_); | ||
66673 | check(numberOfExistingOppositeReferences < 1); | ||
66674 | // The reference is containment, then a new reference cannot be create if: | ||
66675 | // 1. Multiple parents | ||
66676 | neg find mustContains4(problem,interpretation,_,target); | ||
66677 | // 2. Circle in the containment hierarchy | ||
66678 | neg find mustTransitiveContains(source,target); | ||
66679 | } or { | ||
66680 | find mustInRelationsubElements_reference_Function(problem,interpretation,source,target); | ||
66681 | } | ||
66682 | /** | ||
66683 | * Matcher for detecting tuples t where []data reference FAMTerminator(source,target) | ||
66684 | */ | ||
66685 | private pattern mustInRelationdata_reference_FAMTerminator( | ||
66686 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
66687 | source: DefinedElement, target:DefinedElement) | ||
66688 | { | ||
66689 | find interpretation(problem,interpretation); | ||
66690 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
66691 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"data reference FAMTerminator"); | ||
66692 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
66693 | BinaryElementRelationLink.param1(link,source); | ||
66694 | BinaryElementRelationLink.param2(link,target); | ||
66695 | } | ||
66696 | /** | ||
66697 | * Matcher for detecting tuples t where <>data reference FAMTerminator(source,target) | ||
66698 | */ | ||
66699 | private pattern mayInRelationdata_reference_FAMTerminator( | ||
66700 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
66701 | source: DefinedElement, target:DefinedElement) | ||
66702 | { | ||
66703 | find interpretation(problem,interpretation); | ||
66704 | // The two endpoint of the link have to exist | ||
66705 | find mayExist(problem, interpretation, source); | ||
66706 | find mayExist(problem, interpretation, target); | ||
66707 | // Type consistency | ||
66708 | find mayInstanceOfFAMTerminator_class(problem,interpretation,source); | ||
66709 | find mayInstanceOfFunctionalData_class(problem,interpretation,target); | ||
66710 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
66711 | // the upper bound of the multiplicity should be considered. | ||
66712 | numberOfExistingReferences == count find mustInRelationdata_reference_FAMTerminator(problem,interpretation,source,_); | ||
66713 | check(numberOfExistingReferences < 1); | ||
66714 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
66715 | // the upper bound of the opposite reference multiplicity should be considered. | ||
66716 | numberOfExistingOppositeReferences == count find mustInRelationterminator_reference_FunctionalData(problem,interpretation,target,_); | ||
66717 | check(numberOfExistingOppositeReferences < 1); | ||
66718 | // The eOpposite of the reference is containment, then a referene cannot be created if | ||
66719 | // 1. Multiple parents | ||
66720 | neg find mustContains4(problem,interpretation,source,_); | ||
66721 | // 2. Circle in the containment hierarchy | ||
66722 | neg find mustTransitiveContains(source,target); | ||
66723 | } or { | ||
66724 | find mustInRelationdata_reference_FAMTerminator(problem,interpretation,source,target); | ||
66725 | } | ||
66726 | /** | ||
66727 | * Matcher for detecting tuples t where []from reference InformationLink(source,target) | ||
66728 | */ | ||
66729 | private pattern mustInRelationfrom_reference_InformationLink( | ||
66730 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
66731 | source: DefinedElement, target:DefinedElement) | ||
66732 | { | ||
66733 | find interpretation(problem,interpretation); | ||
66734 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
66735 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"from reference InformationLink"); | ||
66736 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
66737 | BinaryElementRelationLink.param1(link,source); | ||
66738 | BinaryElementRelationLink.param2(link,target); | ||
66739 | } | ||
66740 | /** | ||
66741 | * Matcher for detecting tuples t where <>from reference InformationLink(source,target) | ||
66742 | */ | ||
66743 | private pattern mayInRelationfrom_reference_InformationLink( | ||
66744 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
66745 | source: DefinedElement, target:DefinedElement) | ||
66746 | { | ||
66747 | find interpretation(problem,interpretation); | ||
66748 | // The two endpoint of the link have to exist | ||
66749 | find mayExist(problem, interpretation, source); | ||
66750 | find mayExist(problem, interpretation, target); | ||
66751 | // Type consistency | ||
66752 | find mayInstanceOfInformationLink_class(problem,interpretation,source); | ||
66753 | find mayInstanceOfFunctionalOutput_class(problem,interpretation,target); | ||
66754 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
66755 | // the upper bound of the multiplicity should be considered. | ||
66756 | numberOfExistingReferences == count find mustInRelationfrom_reference_InformationLink(problem,interpretation,source,_); | ||
66757 | check(numberOfExistingReferences < 1); | ||
66758 | // The eOpposite of the reference is containment, then a referene cannot be created if | ||
66759 | // 1. Multiple parents | ||
66760 | neg find mustContains4(problem,interpretation,source,_); | ||
66761 | // 2. Circle in the containment hierarchy | ||
66762 | neg find mustTransitiveContains(source,target); | ||
66763 | } or { | ||
66764 | find mustInRelationfrom_reference_InformationLink(problem,interpretation,source,target); | ||
66765 | } | ||
66766 | /** | ||
66767 | * Matcher for detecting tuples t where []to reference InformationLink(source,target) | ||
66768 | */ | ||
66769 | private pattern mustInRelationto_reference_InformationLink( | ||
66770 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
66771 | source: DefinedElement, target:DefinedElement) | ||
66772 | { | ||
66773 | find interpretation(problem,interpretation); | ||
66774 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
66775 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"to reference InformationLink"); | ||
66776 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
66777 | BinaryElementRelationLink.param1(link,source); | ||
66778 | BinaryElementRelationLink.param2(link,target); | ||
66779 | } | ||
66780 | /** | ||
66781 | * Matcher for detecting tuples t where <>to reference InformationLink(source,target) | ||
66782 | */ | ||
66783 | private pattern mayInRelationto_reference_InformationLink( | ||
66784 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
66785 | source: DefinedElement, target:DefinedElement) | ||
66786 | { | ||
66787 | find interpretation(problem,interpretation); | ||
66788 | // The two endpoint of the link have to exist | ||
66789 | find mayExist(problem, interpretation, source); | ||
66790 | find mayExist(problem, interpretation, target); | ||
66791 | // Type consistency | ||
66792 | find mayInstanceOfInformationLink_class(problem,interpretation,source); | ||
66793 | find mayInstanceOfFunctionalInput_class(problem,interpretation,target); | ||
66794 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
66795 | // the upper bound of the multiplicity should be considered. | ||
66796 | numberOfExistingReferences == count find mustInRelationto_reference_InformationLink(problem,interpretation,source,_); | ||
66797 | check(numberOfExistingReferences < 1); | ||
66798 | } or { | ||
66799 | find mustInRelationto_reference_InformationLink(problem,interpretation,source,target); | ||
66800 | } | ||
66801 | /** | ||
66802 | * Matcher for detecting tuples t where []data reference FunctionalInterface(source,target) | ||
66803 | */ | ||
66804 | private pattern mustInRelationdata_reference_FunctionalInterface( | ||
66805 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
66806 | source: DefinedElement, target:DefinedElement) | ||
66807 | { | ||
66808 | find interpretation(problem,interpretation); | ||
66809 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
66810 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"data reference FunctionalInterface"); | ||
66811 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
66812 | BinaryElementRelationLink.param1(link,source); | ||
66813 | BinaryElementRelationLink.param2(link,target); | ||
66814 | } | ||
66815 | /** | ||
66816 | * Matcher for detecting tuples t where <>data reference FunctionalInterface(source,target) | ||
66817 | */ | ||
66818 | private pattern mayInRelationdata_reference_FunctionalInterface( | ||
66819 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
66820 | source: DefinedElement, target:DefinedElement) | ||
66821 | { | ||
66822 | find interpretation(problem,interpretation); | ||
66823 | // The two endpoint of the link have to exist | ||
66824 | find mayExist(problem, interpretation, source); | ||
66825 | find mayExist(problem, interpretation, target); | ||
66826 | // Type consistency | ||
66827 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,source); | ||
66828 | find mayInstanceOfFunctionalData_class(problem,interpretation,target); | ||
66829 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
66830 | // the upper bound of the opposite reference multiplicity should be considered. | ||
66831 | numberOfExistingOppositeReferences == count find mustInRelationinterface_reference_FunctionalData(problem,interpretation,target,_); | ||
66832 | check(numberOfExistingOppositeReferences < 1); | ||
66833 | // The reference is containment, then a new reference cannot be create if: | ||
66834 | // 1. Multiple parents | ||
66835 | neg find mustContains4(problem,interpretation,_,target); | ||
66836 | // 2. Circle in the containment hierarchy | ||
66837 | neg find mustTransitiveContains(source,target); | ||
66838 | } or { | ||
66839 | find mustInRelationdata_reference_FunctionalInterface(problem,interpretation,source,target); | ||
66840 | } | ||
66841 | /** | ||
66842 | * Matcher for detecting tuples t where []element reference FunctionalInterface(source,target) | ||
66843 | */ | ||
66844 | private pattern mustInRelationelement_reference_FunctionalInterface( | ||
66845 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
66846 | source: DefinedElement, target:DefinedElement) | ||
66847 | { | ||
66848 | find interpretation(problem,interpretation); | ||
66849 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
66850 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"element reference FunctionalInterface"); | ||
66851 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
66852 | BinaryElementRelationLink.param1(link,source); | ||
66853 | BinaryElementRelationLink.param2(link,target); | ||
66854 | } | ||
66855 | /** | ||
66856 | * Matcher for detecting tuples t where <>element reference FunctionalInterface(source,target) | ||
66857 | */ | ||
66858 | private pattern mayInRelationelement_reference_FunctionalInterface( | ||
66859 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
66860 | source: DefinedElement, target:DefinedElement) | ||
66861 | { | ||
66862 | find interpretation(problem,interpretation); | ||
66863 | // The two endpoint of the link have to exist | ||
66864 | find mayExist(problem, interpretation, source); | ||
66865 | find mayExist(problem, interpretation, target); | ||
66866 | // Type consistency | ||
66867 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,source); | ||
66868 | find mayInstanceOfFunctionalElement_class(problem,interpretation,target); | ||
66869 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
66870 | // the upper bound of the multiplicity should be considered. | ||
66871 | numberOfExistingReferences == count find mustInRelationelement_reference_FunctionalInterface(problem,interpretation,source,_); | ||
66872 | check(numberOfExistingReferences < 1); | ||
66873 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
66874 | // the upper bound of the opposite reference multiplicity should be considered. | ||
66875 | numberOfExistingOppositeReferences == count find mustInRelationinterface_reference_FunctionalElement(problem,interpretation,target,_); | ||
66876 | check(numberOfExistingOppositeReferences < 1); | ||
66877 | // The eOpposite of the reference is containment, then a referene cannot be created if | ||
66878 | // 1. Multiple parents | ||
66879 | neg find mustContains4(problem,interpretation,source,_); | ||
66880 | // 2. Circle in the containment hierarchy | ||
66881 | neg find mustTransitiveContains(source,target); | ||
66882 | } or { | ||
66883 | find mustInRelationelement_reference_FunctionalInterface(problem,interpretation,source,target); | ||
66884 | } | ||
66885 | /** | ||
66886 | * Matcher for detecting tuples t where []IncomingLinks reference FunctionalInput(source,target) | ||
66887 | */ | ||
66888 | private pattern mustInRelationIncomingLinks_reference_FunctionalInput( | ||
66889 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
66890 | source: DefinedElement, target:DefinedElement) | ||
66891 | { | ||
66892 | find interpretation(problem,interpretation); | ||
66893 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
66894 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"IncomingLinks reference FunctionalInput"); | ||
66895 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
66896 | BinaryElementRelationLink.param1(link,source); | ||
66897 | BinaryElementRelationLink.param2(link,target); | ||
66898 | } | ||
66899 | /** | ||
66900 | * Matcher for detecting tuples t where <>IncomingLinks reference FunctionalInput(source,target) | ||
66901 | */ | ||
66902 | private pattern mayInRelationIncomingLinks_reference_FunctionalInput( | ||
66903 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
66904 | source: DefinedElement, target:DefinedElement) | ||
66905 | { | ||
66906 | find interpretation(problem,interpretation); | ||
66907 | // The two endpoint of the link have to exist | ||
66908 | find mayExist(problem, interpretation, source); | ||
66909 | find mayExist(problem, interpretation, target); | ||
66910 | // Type consistency | ||
66911 | find mayInstanceOfFunctionalInput_class(problem,interpretation,source); | ||
66912 | find mayInstanceOfInformationLink_class(problem,interpretation,target); | ||
66913 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
66914 | // the upper bound of the opposite reference multiplicity should be considered. | ||
66915 | numberOfExistingOppositeReferences == count find mustInRelationto_reference_InformationLink(problem,interpretation,target,_); | ||
66916 | check(numberOfExistingOppositeReferences < 1); | ||
66917 | } or { | ||
66918 | find mustInRelationIncomingLinks_reference_FunctionalInput(problem,interpretation,source,target); | ||
66919 | } | ||
66920 | /** | ||
66921 | * Matcher for detecting tuples t where []outgoingLinks reference FunctionalOutput(source,target) | ||
66922 | */ | ||
66923 | private pattern mustInRelationoutgoingLinks_reference_FunctionalOutput( | ||
66924 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
66925 | source: DefinedElement, target:DefinedElement) | ||
66926 | { | ||
66927 | find interpretation(problem,interpretation); | ||
66928 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
66929 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"outgoingLinks reference FunctionalOutput"); | ||
66930 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
66931 | BinaryElementRelationLink.param1(link,source); | ||
66932 | BinaryElementRelationLink.param2(link,target); | ||
66933 | } | ||
66934 | /** | ||
66935 | * Matcher for detecting tuples t where <>outgoingLinks reference FunctionalOutput(source,target) | ||
66936 | */ | ||
66937 | private pattern mayInRelationoutgoingLinks_reference_FunctionalOutput( | ||
66938 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
66939 | source: DefinedElement, target:DefinedElement) | ||
66940 | { | ||
66941 | find interpretation(problem,interpretation); | ||
66942 | // The two endpoint of the link have to exist | ||
66943 | find mayExist(problem, interpretation, source); | ||
66944 | find mayExist(problem, interpretation, target); | ||
66945 | // Type consistency | ||
66946 | find mayInstanceOfFunctionalOutput_class(problem,interpretation,source); | ||
66947 | find mayInstanceOfInformationLink_class(problem,interpretation,target); | ||
66948 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
66949 | // the upper bound of the opposite reference multiplicity should be considered. | ||
66950 | numberOfExistingOppositeReferences == count find mustInRelationfrom_reference_InformationLink(problem,interpretation,target,_); | ||
66951 | check(numberOfExistingOppositeReferences < 1); | ||
66952 | // The reference is containment, then a new reference cannot be create if: | ||
66953 | // 1. Multiple parents | ||
66954 | neg find mustContains4(problem,interpretation,_,target); | ||
66955 | // 2. Circle in the containment hierarchy | ||
66956 | neg find mustTransitiveContains(source,target); | ||
66957 | } or { | ||
66958 | find mustInRelationoutgoingLinks_reference_FunctionalOutput(problem,interpretation,source,target); | ||
66959 | } | ||
66960 | /** | ||
66961 | * Matcher for detecting tuples t where []terminator reference FunctionalData(source,target) | ||
66962 | */ | ||
66963 | private pattern mustInRelationterminator_reference_FunctionalData( | ||
66964 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
66965 | source: DefinedElement, target:DefinedElement) | ||
66966 | { | ||
66967 | find interpretation(problem,interpretation); | ||
66968 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
66969 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"terminator reference FunctionalData"); | ||
66970 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
66971 | BinaryElementRelationLink.param1(link,source); | ||
66972 | BinaryElementRelationLink.param2(link,target); | ||
66973 | } | ||
66974 | /** | ||
66975 | * Matcher for detecting tuples t where <>terminator reference FunctionalData(source,target) | ||
66976 | */ | ||
66977 | private pattern mayInRelationterminator_reference_FunctionalData( | ||
66978 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
66979 | source: DefinedElement, target:DefinedElement) | ||
66980 | { | ||
66981 | find interpretation(problem,interpretation); | ||
66982 | // The two endpoint of the link have to exist | ||
66983 | find mayExist(problem, interpretation, source); | ||
66984 | find mayExist(problem, interpretation, target); | ||
66985 | // Type consistency | ||
66986 | find mayInstanceOfFunctionalData_class(problem,interpretation,source); | ||
66987 | find mayInstanceOfFAMTerminator_class(problem,interpretation,target); | ||
66988 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
66989 | // the upper bound of the multiplicity should be considered. | ||
66990 | numberOfExistingReferences == count find mustInRelationterminator_reference_FunctionalData(problem,interpretation,source,_); | ||
66991 | check(numberOfExistingReferences < 1); | ||
66992 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
66993 | // the upper bound of the opposite reference multiplicity should be considered. | ||
66994 | numberOfExistingOppositeReferences == count find mustInRelationdata_reference_FAMTerminator(problem,interpretation,target,_); | ||
66995 | check(numberOfExistingOppositeReferences < 1); | ||
66996 | // The reference is containment, then a new reference cannot be create if: | ||
66997 | // 1. Multiple parents | ||
66998 | neg find mustContains4(problem,interpretation,_,target); | ||
66999 | // 2. Circle in the containment hierarchy | ||
67000 | neg find mustTransitiveContains(source,target); | ||
67001 | } or { | ||
67002 | find mustInRelationterminator_reference_FunctionalData(problem,interpretation,source,target); | ||
67003 | } | ||
67004 | /** | ||
67005 | * Matcher for detecting tuples t where []interface reference FunctionalData(source,target) | ||
67006 | */ | ||
67007 | private pattern mustInRelationinterface_reference_FunctionalData( | ||
67008 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
67009 | source: DefinedElement, target:DefinedElement) | ||
67010 | { | ||
67011 | find interpretation(problem,interpretation); | ||
67012 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
67013 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"interface reference FunctionalData"); | ||
67014 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
67015 | BinaryElementRelationLink.param1(link,source); | ||
67016 | BinaryElementRelationLink.param2(link,target); | ||
67017 | } | ||
67018 | /** | ||
67019 | * Matcher for detecting tuples t where <>interface reference FunctionalData(source,target) | ||
67020 | */ | ||
67021 | private pattern mayInRelationinterface_reference_FunctionalData( | ||
67022 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
67023 | source: DefinedElement, target:DefinedElement) | ||
67024 | { | ||
67025 | find interpretation(problem,interpretation); | ||
67026 | // The two endpoint of the link have to exist | ||
67027 | find mayExist(problem, interpretation, source); | ||
67028 | find mayExist(problem, interpretation, target); | ||
67029 | // Type consistency | ||
67030 | find mayInstanceOfFunctionalData_class(problem,interpretation,source); | ||
67031 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,target); | ||
67032 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
67033 | // the upper bound of the multiplicity should be considered. | ||
67034 | numberOfExistingReferences == count find mustInRelationinterface_reference_FunctionalData(problem,interpretation,source,_); | ||
67035 | check(numberOfExistingReferences < 1); | ||
67036 | // The eOpposite of the reference is containment, then a referene cannot be created if | ||
67037 | // 1. Multiple parents | ||
67038 | neg find mustContains4(problem,interpretation,source,_); | ||
67039 | // 2. Circle in the containment hierarchy | ||
67040 | neg find mustTransitiveContains(source,target); | ||
67041 | } or { | ||
67042 | find mustInRelationinterface_reference_FunctionalData(problem,interpretation,source,target); | ||
67043 | } | ||
67044 | /** | ||
67045 | * Matcher for detecting tuples t where []type attribute Function(source,target) | ||
67046 | */ | ||
67047 | private pattern mustInRelationtype_attribute_Function( | ||
67048 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
67049 | source: DefinedElement, target:DefinedElement) | ||
67050 | { | ||
67051 | find interpretation(problem,interpretation); | ||
67052 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
67053 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"type attribute Function"); | ||
67054 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
67055 | BinaryElementRelationLink.param1(link,source); | ||
67056 | BinaryElementRelationLink.param2(link,target); | ||
67057 | } | ||
67058 | /** | ||
67059 | * Matcher for detecting tuples t where <>type attribute Function(source,target) | ||
67060 | */ | ||
67061 | private pattern mayInRelationtype_attribute_Function( | ||
67062 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
67063 | source: DefinedElement, target:DefinedElement) | ||
67064 | { | ||
67065 | find interpretation(problem,interpretation); | ||
67066 | // The two endpoint of the link have to exist | ||
67067 | find mayExist(problem, interpretation, source); | ||
67068 | find mayExist(problem, interpretation, target); | ||
67069 | // Type consistency | ||
67070 | find mayInstanceOfFunction_class(problem,interpretation,source); | ||
67071 | find mayInstanceOfFunctionType_enum(problem,interpretation,target); | ||
67072 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
67073 | // the upper bound of the multiplicity should be considered. | ||
67074 | numberOfExistingReferences == count find mustInRelationtype_attribute_Function(problem,interpretation,source,_); | ||
67075 | check(numberOfExistingReferences < 1); | ||
67076 | } or { | ||
67077 | find mustInRelationtype_attribute_Function(problem,interpretation,source,target); | ||
67078 | } | ||
67079 | |||
67080 | ////////// | ||
67081 | // 1.3 Relation Definition Indexers | ||
67082 | ////////// | ||
67083 | // Must, May and Current queries for pattern ca mcgill ecse dslreasoner standalone test fam queries terminatorAndInformation | ||
67084 | private pattern mustInRelation_pattern_ca_mcgill_ecse_dslreasoner_standalone_test_fam_queries_terminatorAndInformation( | ||
67085 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
67086 | var_T, var_I) | ||
67087 | { | ||
67088 | find interpretation(problem,interpretation); | ||
67089 | find mustInstanceOfFAMTerminator_class(problem,interpretation,var_T); | ||
67090 | find mustInstanceOfInformationLink_class(problem,interpretation,var_I); | ||
67091 | // T is exported | ||
67092 | // I is exported | ||
67093 | find mustInstanceOfFunctionalOutput_class(problem,interpretation,var_Out); | ||
67094 | find mustInRelationoutgoingLinks_reference_FunctionalOutput(problem,interpretation,var_Out,var_virtual0); | ||
67095 | find mustInstanceOfInformationLink_class(problem,interpretation,var_virtual0); | ||
67096 | var_virtual0 == var_I; | ||
67097 | find mustInstanceOfFunctionalOutput_class(problem,interpretation,var_Out); | ||
67098 | find mustInRelationterminator_reference_FunctionalData(problem,interpretation,var_Out,var_virtual1); | ||
67099 | find mustInstanceOfFAMTerminator_class(problem,interpretation,var_virtual1); | ||
67100 | var_virtual1 == var_T; | ||
67101 | }or{ | ||
67102 | find interpretation(problem,interpretation); | ||
67103 | find mustInstanceOfFAMTerminator_class(problem,interpretation,var_T); | ||
67104 | find mustInstanceOfInformationLink_class(problem,interpretation,var_I); | ||
67105 | // T is exported | ||
67106 | // I is exported | ||
67107 | find mustInstanceOfInformationLink_class(problem,interpretation,var_I); | ||
67108 | find mustInRelationto_reference_InformationLink(problem,interpretation,var_I,var_virtual0); | ||
67109 | find mustInstanceOfFunctionalInput_class(problem,interpretation,var_virtual0); | ||
67110 | var_virtual0 == var_In; | ||
67111 | find mustInstanceOfFunctionalInput_class(problem,interpretation,var_In); | ||
67112 | find mustInRelationterminator_reference_FunctionalData(problem,interpretation,var_In,var_virtual1); | ||
67113 | find mustInstanceOfFAMTerminator_class(problem,interpretation,var_virtual1); | ||
67114 | var_virtual1 == var_T; | ||
67115 | } | ||
67116 | private pattern mayInRelation_pattern_ca_mcgill_ecse_dslreasoner_standalone_test_fam_queries_terminatorAndInformation( | ||
67117 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
67118 | var_T, var_I) | ||
67119 | { | ||
67120 | find interpretation(problem,interpretation); | ||
67121 | find mayInstanceOfFAMTerminator_class(problem,interpretation,var_T); | ||
67122 | find mayInstanceOfInformationLink_class(problem,interpretation,var_I); | ||
67123 | // T is exported | ||
67124 | // I is exported | ||
67125 | find mayInstanceOfFunctionalOutput_class(problem,interpretation,var_Out); | ||
67126 | find mayInRelationoutgoingLinks_reference_FunctionalOutput(problem,interpretation,var_Out,var_virtual0); | ||
67127 | find mayInstanceOfInformationLink_class(problem,interpretation,var_virtual0); | ||
67128 | find mayEquivalent(problem, interpretation, var_virtual0, var_I); | ||
67129 | find mayInstanceOfFunctionalOutput_class(problem,interpretation,var_Out); | ||
67130 | find mayInRelationterminator_reference_FunctionalData(problem,interpretation,var_Out,var_virtual1); | ||
67131 | find mayInstanceOfFAMTerminator_class(problem,interpretation,var_virtual1); | ||
67132 | find mayEquivalent(problem, interpretation, var_virtual1, var_T); | ||
67133 | }or{ | ||
67134 | find interpretation(problem,interpretation); | ||
67135 | find mayInstanceOfFAMTerminator_class(problem,interpretation,var_T); | ||
67136 | find mayInstanceOfInformationLink_class(problem,interpretation,var_I); | ||
67137 | // T is exported | ||
67138 | // I is exported | ||
67139 | find mayInstanceOfInformationLink_class(problem,interpretation,var_I); | ||
67140 | find mayInRelationto_reference_InformationLink(problem,interpretation,var_I,var_virtual0); | ||
67141 | find mayInstanceOfFunctionalInput_class(problem,interpretation,var_virtual0); | ||
67142 | find mayEquivalent(problem, interpretation, var_virtual0, var_In); | ||
67143 | find mayInstanceOfFunctionalInput_class(problem,interpretation,var_In); | ||
67144 | find mayInRelationterminator_reference_FunctionalData(problem,interpretation,var_In,var_virtual1); | ||
67145 | find mayInstanceOfFAMTerminator_class(problem,interpretation,var_virtual1); | ||
67146 | find mayEquivalent(problem, interpretation, var_virtual1, var_T); | ||
67147 | } | ||
67148 | private pattern currentInRelation_pattern_ca_mcgill_ecse_dslreasoner_standalone_test_fam_queries_terminatorAndInformation( | ||
67149 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
67150 | var_T, var_I) | ||
67151 | { | ||
67152 | find interpretation(problem,interpretation); | ||
67153 | find mustInstanceOfFAMTerminator_class(problem,interpretation,var_T); | ||
67154 | find mustInstanceOfInformationLink_class(problem,interpretation,var_I); | ||
67155 | // T is exported | ||
67156 | // I is exported | ||
67157 | find mustInstanceOfFunctionalOutput_class(problem,interpretation,var_Out); | ||
67158 | find mustInRelationoutgoingLinks_reference_FunctionalOutput(problem,interpretation,var_Out,var_virtual0); | ||
67159 | find mustInstanceOfInformationLink_class(problem,interpretation,var_virtual0); | ||
67160 | var_virtual0 == var_I; | ||
67161 | find mustInstanceOfFunctionalOutput_class(problem,interpretation,var_Out); | ||
67162 | find mustInRelationterminator_reference_FunctionalData(problem,interpretation,var_Out,var_virtual1); | ||
67163 | find mustInstanceOfFAMTerminator_class(problem,interpretation,var_virtual1); | ||
67164 | var_virtual1 == var_T; | ||
67165 | }or{ | ||
67166 | find interpretation(problem,interpretation); | ||
67167 | find mustInstanceOfFAMTerminator_class(problem,interpretation,var_T); | ||
67168 | find mustInstanceOfInformationLink_class(problem,interpretation,var_I); | ||
67169 | // T is exported | ||
67170 | // I is exported | ||
67171 | find mustInstanceOfInformationLink_class(problem,interpretation,var_I); | ||
67172 | find mustInRelationto_reference_InformationLink(problem,interpretation,var_I,var_virtual0); | ||
67173 | find mustInstanceOfFunctionalInput_class(problem,interpretation,var_virtual0); | ||
67174 | var_virtual0 == var_In; | ||
67175 | find mustInstanceOfFunctionalInput_class(problem,interpretation,var_In); | ||
67176 | find mustInRelationterminator_reference_FunctionalData(problem,interpretation,var_In,var_virtual1); | ||
67177 | find mustInstanceOfFAMTerminator_class(problem,interpretation,var_virtual1); | ||
67178 | var_virtual1 == var_T; | ||
67179 | } | ||
67180 | // Must, May and Current queries for pattern ca mcgill ecse dslreasoner standalone test fam queries rootElements | ||
67181 | private pattern mustInRelation_pattern_ca_mcgill_ecse_dslreasoner_standalone_test_fam_queries_rootElements( | ||
67182 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
67183 | var_Model, var_Root) | ||
67184 | { | ||
67185 | find interpretation(problem,interpretation); | ||
67186 | find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,var_Model); | ||
67187 | find mustInstanceOfFunction_class(problem,interpretation,var_Root); | ||
67188 | // Model is exported | ||
67189 | // Root is exported | ||
67190 | find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,var_Model); | ||
67191 | find mustInRelationrootElements_reference_FunctionalArchitectureModel(problem,interpretation,var_Model,var_virtual0); | ||
67192 | find mustInstanceOfFunctionalElement_class(problem,interpretation,var_virtual0); | ||
67193 | var_virtual0 == var_Root; | ||
67194 | } | ||
67195 | private pattern mayInRelation_pattern_ca_mcgill_ecse_dslreasoner_standalone_test_fam_queries_rootElements( | ||
67196 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
67197 | var_Model, var_Root) | ||
67198 | { | ||
67199 | find interpretation(problem,interpretation); | ||
67200 | find mayInstanceOfFunctionalArchitectureModel_class(problem,interpretation,var_Model); | ||
67201 | find mayInstanceOfFunction_class(problem,interpretation,var_Root); | ||
67202 | // Model is exported | ||
67203 | // Root is exported | ||
67204 | find mayInstanceOfFunctionalArchitectureModel_class(problem,interpretation,var_Model); | ||
67205 | find mayInRelationrootElements_reference_FunctionalArchitectureModel(problem,interpretation,var_Model,var_virtual0); | ||
67206 | find mayInstanceOfFunctionalElement_class(problem,interpretation,var_virtual0); | ||
67207 | find mayEquivalent(problem, interpretation, var_virtual0, var_Root); | ||
67208 | } | ||
67209 | private pattern currentInRelation_pattern_ca_mcgill_ecse_dslreasoner_standalone_test_fam_queries_rootElements( | ||
67210 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
67211 | var_Model, var_Root) | ||
67212 | { | ||
67213 | find interpretation(problem,interpretation); | ||
67214 | find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,var_Model); | ||
67215 | find mustInstanceOfFunction_class(problem,interpretation,var_Root); | ||
67216 | // Model is exported | ||
67217 | // Root is exported | ||
67218 | find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,var_Model); | ||
67219 | find mustInRelationrootElements_reference_FunctionalArchitectureModel(problem,interpretation,var_Model,var_virtual0); | ||
67220 | find mustInstanceOfFunctionalElement_class(problem,interpretation,var_virtual0); | ||
67221 | var_virtual0 == var_Root; | ||
67222 | } | ||
67223 | // Must, May and Current queries for pattern ca mcgill ecse dslreasoner standalone test fam queries parent | ||
67224 | private pattern mustInRelation_pattern_ca_mcgill_ecse_dslreasoner_standalone_test_fam_queries_parent( | ||
67225 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
67226 | var_Func, var_Par) | ||
67227 | { | ||
67228 | find interpretation(problem,interpretation); | ||
67229 | find mustInstanceOfFunction_class(problem,interpretation,var_Func); | ||
67230 | find mustInstanceOfFunction_class(problem,interpretation,var_Par); | ||
67231 | // Func is exported | ||
67232 | // Par is exported | ||
67233 | find mustInstanceOfFunction_class(problem,interpretation,var_Func); | ||
67234 | find mustInRelationparent_reference_FunctionalElement(problem,interpretation,var_Func,var_virtual0); | ||
67235 | find mustInstanceOfFunction_class(problem,interpretation,var_virtual0); | ||
67236 | var_virtual0 == var_Par; | ||
67237 | } | ||
67238 | private pattern mayInRelation_pattern_ca_mcgill_ecse_dslreasoner_standalone_test_fam_queries_parent( | ||
67239 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
67240 | var_Func, var_Par) | ||
67241 | { | ||
67242 | find interpretation(problem,interpretation); | ||
67243 | find mayInstanceOfFunction_class(problem,interpretation,var_Func); | ||
67244 | find mayInstanceOfFunction_class(problem,interpretation,var_Par); | ||
67245 | // Func is exported | ||
67246 | // Par is exported | ||
67247 | find mayInstanceOfFunction_class(problem,interpretation,var_Func); | ||
67248 | find mayInRelationparent_reference_FunctionalElement(problem,interpretation,var_Func,var_virtual0); | ||
67249 | find mayInstanceOfFunction_class(problem,interpretation,var_virtual0); | ||
67250 | find mayEquivalent(problem, interpretation, var_virtual0, var_Par); | ||
67251 | } | ||
67252 | private pattern currentInRelation_pattern_ca_mcgill_ecse_dslreasoner_standalone_test_fam_queries_parent( | ||
67253 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
67254 | var_Func, var_Par) | ||
67255 | { | ||
67256 | find interpretation(problem,interpretation); | ||
67257 | find mustInstanceOfFunction_class(problem,interpretation,var_Func); | ||
67258 | find mustInstanceOfFunction_class(problem,interpretation,var_Par); | ||
67259 | // Func is exported | ||
67260 | // Par is exported | ||
67261 | find mustInstanceOfFunction_class(problem,interpretation,var_Func); | ||
67262 | find mustInRelationparent_reference_FunctionalElement(problem,interpretation,var_Func,var_virtual0); | ||
67263 | find mustInstanceOfFunction_class(problem,interpretation,var_virtual0); | ||
67264 | var_virtual0 == var_Par; | ||
67265 | } | ||
67266 | |||
67267 | ////////// | ||
67268 | // 1.4 Containment Indexer | ||
67269 | ////////// | ||
67270 | private pattern mustContains2(source: DefinedElement, target: DefinedElement) { | ||
67271 | find mustContains4(_,_,source,target); | ||
67272 | } | ||
67273 | |||
67274 | private pattern mustContains4(problem:LogicProblem, interpretation:PartialInterpretation, | ||
67275 | source: DefinedElement, target: DefinedElement) | ||
67276 | { find mustInRelationinterface_reference_FunctionalElement(problem,interpretation,source,target); }or | ||
67277 | |||
67278 | { find mustInRelationrootElements_reference_FunctionalArchitectureModel(problem,interpretation,source,target); }or | ||
67279 | |||
67280 | { find mustInRelationsubElements_reference_Function(problem,interpretation,source,target); }or | ||
67281 | |||
67282 | { find mustInRelationdata_reference_FunctionalInterface(problem,interpretation,source,target); }or | ||
67283 | |||
67284 | { find mustInRelationoutgoingLinks_reference_FunctionalOutput(problem,interpretation,source,target); }or | ||
67285 | |||
67286 | { find mustInRelationterminator_reference_FunctionalData(problem,interpretation,source,target); } | ||
67287 | |||
67288 | private pattern mustTransitiveContains(source,target) { | ||
67289 | find mustContains2+(source,target); | ||
67290 | } | ||
67291 | |||
67292 | ////////// | ||
67293 | // 2. Invalidation Indexers | ||
67294 | ////////// | ||
67295 | // 2.1 Invalidated by WF Queries | ||
67296 | ////////// | ||
67297 | pattern invalidatedBy_pattern_ca_mcgill_ecse_dslreasoner_standalone_test_fam_queries_terminatorAndInformation(problem:LogicProblem, interpretation:PartialInterpretation, | ||
67298 | var_T, var_I) | ||
67299 | { | ||
67300 | find mustInRelation_pattern_ca_mcgill_ecse_dslreasoner_standalone_test_fam_queries_terminatorAndInformation(problem,interpretation,var_T,var_I); | ||
67301 | } | ||
67302 | |||
67303 | ////////// | ||
67304 | // 3. Unfinishedness Indexers | ||
67305 | ////////// | ||
67306 | // 3.1 Unfinishedness Measured by Multiplicity | ||
67307 | ////////// | ||
67308 | pattern unfinishedLowerMultiplicity_model_reference_FunctionalElement(problem:LogicProblem, interpretation:PartialInterpretation, relationIterpretation:PartialRelationInterpretation, object:DefinedElement,missingMultiplicity) { | ||
67309 | find interpretation(problem,interpretation); | ||
67310 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
67311 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"model reference FunctionalElement"); | ||
67312 | find mustInstanceOfFunctionalElement_class(problem,interpretation,object); | ||
67313 | numberOfExistingReferences == count find mustInRelationmodel_reference_FunctionalElement(problem,interpretation,object,_); | ||
67314 | check(numberOfExistingReferences < 1); | ||
67315 | missingMultiplicity == eval(1-numberOfExistingReferences); | ||
67316 | } | ||
67317 | pattern unfinishedLowerMultiplicity_to_reference_InformationLink(problem:LogicProblem, interpretation:PartialInterpretation, relationIterpretation:PartialRelationInterpretation, object:DefinedElement,missingMultiplicity) { | ||
67318 | find interpretation(problem,interpretation); | ||
67319 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
67320 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"to reference InformationLink"); | ||
67321 | find mustInstanceOfInformationLink_class(problem,interpretation,object); | ||
67322 | numberOfExistingReferences == count find mustInRelationto_reference_InformationLink(problem,interpretation,object,_); | ||
67323 | check(numberOfExistingReferences < 1); | ||
67324 | missingMultiplicity == eval(1-numberOfExistingReferences); | ||
67325 | } | ||
67326 | pattern unfinishedLowerMultiplicity_type_attribute_Function(problem:LogicProblem, interpretation:PartialInterpretation, relationIterpretation:PartialRelationInterpretation, object:DefinedElement,missingMultiplicity) { | ||
67327 | find interpretation(problem,interpretation); | ||
67328 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
67329 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"type attribute Function"); | ||
67330 | find mustInstanceOfFunction_class(problem,interpretation,object); | ||
67331 | numberOfExistingReferences == count find mustInRelationtype_attribute_Function(problem,interpretation,object,_); | ||
67332 | check(numberOfExistingReferences < 1); | ||
67333 | missingMultiplicity == eval(1-numberOfExistingReferences); | ||
67334 | } | ||
67335 | |||
67336 | ////////// | ||
67337 | // 3.2 Unfinishedness Measured by WF Queries | ||
67338 | ////////// | ||
67339 | pattern unfinishedBy_pattern_ca_mcgill_ecse_dslreasoner_standalone_test_fam_queries_terminatorAndInformation(problem:LogicProblem, interpretation:PartialInterpretation, | ||
67340 | var_T, var_I) | ||
67341 | { | ||
67342 | find currentInRelation_pattern_ca_mcgill_ecse_dslreasoner_standalone_test_fam_queries_terminatorAndInformation(problem,interpretation,var_T,var_I); | ||
67343 | } | ||
67344 | |||
67345 | ////////// | ||
67346 | // 4. Refinement Indexers | ||
67347 | ////////// | ||
67348 | // 4.1 Object constructors | ||
67349 | ////////// | ||
67350 | private pattern hasElementInContainment(problem:LogicProblem, interpretation:PartialInterpretation) | ||
67351 | { | ||
67352 | find interpretation(problem,interpretation); | ||
67353 | find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,root); | ||
67354 | find mustExist(problem, interpretation, root); | ||
67355 | }or{ | ||
67356 | find interpretation(problem,interpretation); | ||
67357 | find mustInstanceOfFunctionalInput_class(problem,interpretation,root); | ||
67358 | find mustExist(problem, interpretation, root); | ||
67359 | }or{ | ||
67360 | find interpretation(problem,interpretation); | ||
67361 | find mustInstanceOfFunctionalOutput_class(problem,interpretation,root); | ||
67362 | find mustExist(problem, interpretation, root); | ||
67363 | }or{ | ||
67364 | find interpretation(problem,interpretation); | ||
67365 | find mustInstanceOfFAMTerminator_class(problem,interpretation,root); | ||
67366 | find mustExist(problem, interpretation, root); | ||
67367 | }or{ | ||
67368 | find interpretation(problem,interpretation); | ||
67369 | find mustInstanceOfFunctionalInterface_class(problem,interpretation,root); | ||
67370 | find mustExist(problem, interpretation, root); | ||
67371 | }or{ | ||
67372 | find interpretation(problem,interpretation); | ||
67373 | find mustInstanceOfFunction_class(problem,interpretation,root); | ||
67374 | find mustExist(problem, interpretation, root); | ||
67375 | }or{ | ||
67376 | find interpretation(problem,interpretation); | ||
67377 | find mustInstanceOfInformationLink_class(problem,interpretation,root); | ||
67378 | find mustExist(problem, interpretation, root); | ||
67379 | }or{ | ||
67380 | find interpretation(problem,interpretation); | ||
67381 | find mustInstanceOfFunctionalElement_class(problem,interpretation,root); | ||
67382 | find mustExist(problem, interpretation, root); | ||
67383 | }or{ | ||
67384 | find interpretation(problem,interpretation); | ||
67385 | find mustInstanceOfFunctionalData_class(problem,interpretation,root); | ||
67386 | find mustExist(problem, interpretation, root); | ||
67387 | }or{ | ||
67388 | find interpretation(problem,interpretation); | ||
67389 | find mustInstanceOfFunctionalArchitectureModel_class_DefinedPart(problem,interpretation,root); | ||
67390 | find mustExist(problem, interpretation, root); | ||
67391 | }or{ | ||
67392 | find interpretation(problem,interpretation); | ||
67393 | find mustInstanceOfFunctionalArchitectureModel_class_UndefinedPart(problem,interpretation,root); | ||
67394 | find mustExist(problem, interpretation, root); | ||
67395 | } | ||
67396 | pattern createObject_FunctionalArchitectureModel_class_UndefinedPart( | ||
67397 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
67398 | typeInterpretation:PartialComplexTypeInterpretation) | ||
67399 | { | ||
67400 | find interpretation(problem,interpretation); | ||
67401 | neg find hasElementInContainment(problem,interpretation); | ||
67402 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
67403 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalArchitectureModel class UndefinedPart"); | ||
67404 | find mayInstanceOfFunctionalArchitectureModel_class_UndefinedPart(problem,interpretation,newObject); | ||
67405 | find mayExist(problem, interpretation, newObject); | ||
67406 | neg find mustExist(problem, interpretation, newObject); | ||
67407 | } | ||
67408 | pattern createObject_FunctionalInput_class_by_data_reference_FunctionalInterface_with_interface_reference_FunctionalData( | ||
67409 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
67410 | relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
67411 | container:DefinedElement) | ||
67412 | { | ||
67413 | find interpretation(problem,interpretation); | ||
67414 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
67415 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalInput class"); | ||
67416 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
67417 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"data reference FunctionalInterface"); | ||
67418 | PartialInterpretation.partialrelationinterpretation(interpretation,inverseInterpretation); | ||
67419 | PartialRelationInterpretation.interpretationOf.name(inverseInterpretation,"interface reference FunctionalData"); | ||
67420 | find mustInstanceOfFunctionalInterface_class(problem,interpretation,container); | ||
67421 | find mayInstanceOfFunctionalInput_class(problem,interpretation,newObject); | ||
67422 | find mayInRelationdata_reference_FunctionalInterface(problem,interpretation,container,newObject); | ||
67423 | find mustExist(problem, interpretation, container); | ||
67424 | neg find mustExist(problem, interpretation, newObject); | ||
67425 | } | ||
67426 | pattern createObject_FunctionalInput_class( | ||
67427 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
67428 | typeInterpretation:PartialComplexTypeInterpretation) | ||
67429 | { | ||
67430 | find interpretation(problem,interpretation); | ||
67431 | neg find hasElementInContainment(problem,interpretation); | ||
67432 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
67433 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalInput class"); | ||
67434 | find mayInstanceOfFunctionalInput_class(problem,interpretation,newObject); | ||
67435 | find mayExist(problem, interpretation, newObject); | ||
67436 | neg find mustExist(problem, interpretation, newObject); | ||
67437 | } | ||
67438 | pattern createObject_Function_class_by_rootElements_reference_FunctionalArchitectureModel( | ||
67439 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
67440 | relationInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
67441 | container:DefinedElement) | ||
67442 | { | ||
67443 | find interpretation(problem,interpretation); | ||
67444 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
67445 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"Function class"); | ||
67446 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
67447 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"rootElements reference FunctionalArchitectureModel"); | ||
67448 | find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,container); | ||
67449 | find mayInstanceOfFunction_class(problem,interpretation,newObject); | ||
67450 | find mayInRelationrootElements_reference_FunctionalArchitectureModel(problem,interpretation,container,newObject); | ||
67451 | find mustExist(problem, interpretation, container); | ||
67452 | neg find mustExist(problem, interpretation, newObject); | ||
67453 | } | ||
67454 | pattern createObject_Function_class_by_subElements_reference_Function_with_parent_reference_FunctionalElement( | ||
67455 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
67456 | relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
67457 | container:DefinedElement) | ||
67458 | { | ||
67459 | find interpretation(problem,interpretation); | ||
67460 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
67461 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"Function class"); | ||
67462 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
67463 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"subElements reference Function"); | ||
67464 | PartialInterpretation.partialrelationinterpretation(interpretation,inverseInterpretation); | ||
67465 | PartialRelationInterpretation.interpretationOf.name(inverseInterpretation,"parent reference FunctionalElement"); | ||
67466 | find mustInstanceOfFunction_class(problem,interpretation,container); | ||
67467 | find mayInstanceOfFunction_class(problem,interpretation,newObject); | ||
67468 | find mayInRelationsubElements_reference_Function(problem,interpretation,container,newObject); | ||
67469 | find mustExist(problem, interpretation, container); | ||
67470 | neg find mustExist(problem, interpretation, newObject); | ||
67471 | } | ||
67472 | pattern createObject_Function_class( | ||
67473 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
67474 | typeInterpretation:PartialComplexTypeInterpretation) | ||
67475 | { | ||
67476 | find interpretation(problem,interpretation); | ||
67477 | neg find hasElementInContainment(problem,interpretation); | ||
67478 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
67479 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"Function class"); | ||
67480 | find mayInstanceOfFunction_class(problem,interpretation,newObject); | ||
67481 | find mayExist(problem, interpretation, newObject); | ||
67482 | neg find mustExist(problem, interpretation, newObject); | ||
67483 | } | ||
67484 | pattern createObject_InformationLink_class_by_outgoingLinks_reference_FunctionalOutput_with_from_reference_InformationLink( | ||
67485 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
67486 | relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
67487 | container:DefinedElement) | ||
67488 | { | ||
67489 | find interpretation(problem,interpretation); | ||
67490 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
67491 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"InformationLink class"); | ||
67492 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
67493 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"outgoingLinks reference FunctionalOutput"); | ||
67494 | PartialInterpretation.partialrelationinterpretation(interpretation,inverseInterpretation); | ||
67495 | PartialRelationInterpretation.interpretationOf.name(inverseInterpretation,"from reference InformationLink"); | ||
67496 | find mustInstanceOfFunctionalOutput_class(problem,interpretation,container); | ||
67497 | find mayInstanceOfInformationLink_class(problem,interpretation,newObject); | ||
67498 | find mayInRelationoutgoingLinks_reference_FunctionalOutput(problem,interpretation,container,newObject); | ||
67499 | find mustExist(problem, interpretation, container); | ||
67500 | neg find mustExist(problem, interpretation, newObject); | ||
67501 | } | ||
67502 | pattern createObject_InformationLink_class( | ||
67503 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
67504 | typeInterpretation:PartialComplexTypeInterpretation) | ||
67505 | { | ||
67506 | find interpretation(problem,interpretation); | ||
67507 | neg find hasElementInContainment(problem,interpretation); | ||
67508 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
67509 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"InformationLink class"); | ||
67510 | find mayInstanceOfInformationLink_class(problem,interpretation,newObject); | ||
67511 | find mayExist(problem, interpretation, newObject); | ||
67512 | neg find mustExist(problem, interpretation, newObject); | ||
67513 | } | ||
67514 | pattern createObject_FunctionalInterface_class_by_interface_reference_FunctionalElement_with_element_reference_FunctionalInterface( | ||
67515 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
67516 | relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
67517 | container:DefinedElement) | ||
67518 | { | ||
67519 | find interpretation(problem,interpretation); | ||
67520 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
67521 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalInterface class"); | ||
67522 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
67523 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"interface reference FunctionalElement"); | ||
67524 | PartialInterpretation.partialrelationinterpretation(interpretation,inverseInterpretation); | ||
67525 | PartialRelationInterpretation.interpretationOf.name(inverseInterpretation,"element reference FunctionalInterface"); | ||
67526 | find mustInstanceOfFunctionalElement_class(problem,interpretation,container); | ||
67527 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,newObject); | ||
67528 | find mayInRelationinterface_reference_FunctionalElement(problem,interpretation,container,newObject); | ||
67529 | find mustExist(problem, interpretation, container); | ||
67530 | neg find mustExist(problem, interpretation, newObject); | ||
67531 | } | ||
67532 | pattern createObject_FunctionalInterface_class( | ||
67533 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
67534 | typeInterpretation:PartialComplexTypeInterpretation) | ||
67535 | { | ||
67536 | find interpretation(problem,interpretation); | ||
67537 | neg find hasElementInContainment(problem,interpretation); | ||
67538 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
67539 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalInterface class"); | ||
67540 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,newObject); | ||
67541 | find mayExist(problem, interpretation, newObject); | ||
67542 | neg find mustExist(problem, interpretation, newObject); | ||
67543 | } | ||
67544 | pattern createObject_FAMTerminator_class_by_terminator_reference_FunctionalData_with_data_reference_FAMTerminator( | ||
67545 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
67546 | relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
67547 | container:DefinedElement) | ||
67548 | { | ||
67549 | find interpretation(problem,interpretation); | ||
67550 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
67551 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FAMTerminator class"); | ||
67552 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
67553 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"terminator reference FunctionalData"); | ||
67554 | PartialInterpretation.partialrelationinterpretation(interpretation,inverseInterpretation); | ||
67555 | PartialRelationInterpretation.interpretationOf.name(inverseInterpretation,"data reference FAMTerminator"); | ||
67556 | find mustInstanceOfFunctionalData_class(problem,interpretation,container); | ||
67557 | find mayInstanceOfFAMTerminator_class(problem,interpretation,newObject); | ||
67558 | find mayInRelationterminator_reference_FunctionalData(problem,interpretation,container,newObject); | ||
67559 | find mustExist(problem, interpretation, container); | ||
67560 | neg find mustExist(problem, interpretation, newObject); | ||
67561 | } | ||
67562 | pattern createObject_FAMTerminator_class( | ||
67563 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
67564 | typeInterpretation:PartialComplexTypeInterpretation) | ||
67565 | { | ||
67566 | find interpretation(problem,interpretation); | ||
67567 | neg find hasElementInContainment(problem,interpretation); | ||
67568 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
67569 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FAMTerminator class"); | ||
67570 | find mayInstanceOfFAMTerminator_class(problem,interpretation,newObject); | ||
67571 | find mayExist(problem, interpretation, newObject); | ||
67572 | neg find mustExist(problem, interpretation, newObject); | ||
67573 | } | ||
67574 | pattern createObject_FunctionalOutput_class_by_data_reference_FunctionalInterface_with_interface_reference_FunctionalData( | ||
67575 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
67576 | relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
67577 | container:DefinedElement) | ||
67578 | { | ||
67579 | find interpretation(problem,interpretation); | ||
67580 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
67581 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalOutput class"); | ||
67582 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
67583 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"data reference FunctionalInterface"); | ||
67584 | PartialInterpretation.partialrelationinterpretation(interpretation,inverseInterpretation); | ||
67585 | PartialRelationInterpretation.interpretationOf.name(inverseInterpretation,"interface reference FunctionalData"); | ||
67586 | find mustInstanceOfFunctionalInterface_class(problem,interpretation,container); | ||
67587 | find mayInstanceOfFunctionalOutput_class(problem,interpretation,newObject); | ||
67588 | find mayInRelationdata_reference_FunctionalInterface(problem,interpretation,container,newObject); | ||
67589 | find mustExist(problem, interpretation, container); | ||
67590 | neg find mustExist(problem, interpretation, newObject); | ||
67591 | } | ||
67592 | pattern createObject_FunctionalOutput_class( | ||
67593 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
67594 | typeInterpretation:PartialComplexTypeInterpretation) | ||
67595 | { | ||
67596 | find interpretation(problem,interpretation); | ||
67597 | neg find hasElementInContainment(problem,interpretation); | ||
67598 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
67599 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalOutput class"); | ||
67600 | find mayInstanceOfFunctionalOutput_class(problem,interpretation,newObject); | ||
67601 | find mayExist(problem, interpretation, newObject); | ||
67602 | neg find mustExist(problem, interpretation, newObject); | ||
67603 | } | ||
67604 | |||
67605 | ////////// | ||
67606 | // 4.2 Type refinement | ||
67607 | ////////// | ||
67608 | pattern refineTypeTo_FunctionalArchitectureModel_class_UndefinedPart(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
67609 | find interpretation(problem,interpretation); | ||
67610 | PartialInterpretation.newElements(interpretation,element); | ||
67611 | find mayInstanceOfFunctionalArchitectureModel_class_UndefinedPart(problem,interpretation,element); | ||
67612 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
67613 | neg find mustInstanceOfFunctionalArchitectureModel_class_UndefinedPart(problem,interpretation,element); | ||
67614 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
67615 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
67616 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
67617 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
67618 | } | ||
67619 | pattern refineTypeTo_FunctionalInput_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
67620 | find interpretation(problem,interpretation); | ||
67621 | PartialInterpretation.newElements(interpretation,element); | ||
67622 | find mayInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
67623 | neg find mustInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
67624 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
67625 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
67626 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
67627 | neg find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
67628 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
67629 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
67630 | } | ||
67631 | pattern refineTypeTo_Function_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
67632 | find interpretation(problem,interpretation); | ||
67633 | PartialInterpretation.newElements(interpretation,element); | ||
67634 | find mayInstanceOfFunction_class(problem,interpretation,element); | ||
67635 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
67636 | neg find mustInstanceOfFunction_class(problem,interpretation,element); | ||
67637 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
67638 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
67639 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
67640 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
67641 | } | ||
67642 | pattern refineTypeTo_InformationLink_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
67643 | find interpretation(problem,interpretation); | ||
67644 | PartialInterpretation.newElements(interpretation,element); | ||
67645 | find mayInstanceOfInformationLink_class(problem,interpretation,element); | ||
67646 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
67647 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
67648 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
67649 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
67650 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
67651 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
67652 | } | ||
67653 | pattern refineTypeTo_FunctionalInterface_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
67654 | find interpretation(problem,interpretation); | ||
67655 | PartialInterpretation.newElements(interpretation,element); | ||
67656 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
67657 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
67658 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
67659 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
67660 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
67661 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
67662 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
67663 | } | ||
67664 | pattern refineTypeTo_FAMTerminator_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
67665 | find interpretation(problem,interpretation); | ||
67666 | PartialInterpretation.newElements(interpretation,element); | ||
67667 | find mayInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
67668 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
67669 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
67670 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
67671 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
67672 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
67673 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
67674 | } | ||
67675 | pattern refineTypeTo_FunctionalOutput_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
67676 | find interpretation(problem,interpretation); | ||
67677 | PartialInterpretation.newElements(interpretation,element); | ||
67678 | find mayInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
67679 | neg find mustInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
67680 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
67681 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
67682 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
67683 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
67684 | neg find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
67685 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
67686 | } | ||
67687 | |||
67688 | ////////// | ||
67689 | // 4.3 Relation refinement | ||
67690 | ////////// | ||
67691 | pattern refineRelation_model_reference_FunctionalElement( | ||
67692 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
67693 | relationIterpretation:PartialRelationInterpretation, | ||
67694 | from: DefinedElement, to: DefinedElement) | ||
67695 | { | ||
67696 | find interpretation(problem,interpretation); | ||
67697 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
67698 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"model reference FunctionalElement"); | ||
67699 | find mustExist(problem, interpretation, from); | ||
67700 | find mustExist(problem, interpretation, to); | ||
67701 | find mustInstanceOfFunctionalElement_class(problem,interpretation,from); | ||
67702 | find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,to); | ||
67703 | find mayInRelationmodel_reference_FunctionalElement(problem,interpretation,from,to); | ||
67704 | neg find mustInRelationmodel_reference_FunctionalElement(problem,interpretation,from,to); | ||
67705 | } | ||
67706 | pattern refineRelation_IncomingLinks_reference_FunctionalInput_and_to_reference_InformationLink( | ||
67707 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
67708 | relationIterpretation:PartialRelationInterpretation, oppositeInterpretation:PartialRelationInterpretation, | ||
67709 | from: DefinedElement, to: DefinedElement) | ||
67710 | { | ||
67711 | find interpretation(problem,interpretation); | ||
67712 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
67713 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"IncomingLinks reference FunctionalInput"); | ||
67714 | PartialInterpretation.partialrelationinterpretation(interpretation,oppositeInterpretation); | ||
67715 | PartialRelationInterpretation.interpretationOf.name(oppositeInterpretation,"to reference InformationLink"); | ||
67716 | find mustExist(problem, interpretation, from); | ||
67717 | find mustExist(problem, interpretation, to); | ||
67718 | find mustInstanceOfFunctionalInput_class(problem,interpretation,from); | ||
67719 | find mustInstanceOfInformationLink_class(problem,interpretation,to); | ||
67720 | find mayInRelationIncomingLinks_reference_FunctionalInput(problem,interpretation,from,to); | ||
67721 | neg find mustInRelationIncomingLinks_reference_FunctionalInput(problem,interpretation,from,to); | ||
67722 | } | ||
67723 | pattern refineRelation_type_attribute_Function( | ||
67724 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
67725 | relationIterpretation:PartialRelationInterpretation, | ||
67726 | from: DefinedElement, to: DefinedElement) | ||
67727 | { | ||
67728 | find interpretation(problem,interpretation); | ||
67729 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
67730 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"type attribute Function"); | ||
67731 | find mustExist(problem, interpretation, from); | ||
67732 | find mustExist(problem, interpretation, to); | ||
67733 | find mustInstanceOfFunction_class(problem,interpretation,from); | ||
67734 | find mustInstanceOfFunctionType_enum(problem,interpretation,to); | ||
67735 | find mayInRelationtype_attribute_Function(problem,interpretation,from,to); | ||
67736 | neg find mustInRelationtype_attribute_Function(problem,interpretation,from,to); | ||
67737 | } | ||
67738 | import epackage "http://www.bme.hu/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage" | ||
67739 | import epackage "http://www.bme.hu/mit/inf/dslreasoner/logic/model/problem" | ||
67740 | import epackage "http://www.bme.hu/mit/inf/dslreasoner/logic/model/language" | ||
67741 | |||
67742 | ////////// | ||
67743 | // 0. Util | ||
67744 | ////////// | ||
67745 | private pattern interpretation(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
67746 | PartialInterpretation.problem(interpretation,problem); | ||
67747 | } | ||
67748 | |||
67749 | ///////////////////////// | ||
67750 | // 0.1 Existence | ||
67751 | ///////////////////////// | ||
67752 | private pattern mustExist(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
67753 | find interpretation(problem,interpretation); | ||
67754 | LogicProblem.elements(problem,element); | ||
67755 | } or { | ||
67756 | find interpretation(problem,interpretation); | ||
67757 | PartialInterpretation.newElements(interpretation,element); | ||
67758 | } | ||
67759 | |||
67760 | private pattern mayExist(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
67761 | find mustExist(problem,interpretation,element); | ||
67762 | } or { | ||
67763 | find interpretation(problem,interpretation); | ||
67764 | neg find elementCloseWorld(element); | ||
67765 | PartialInterpretation.openWorldElements(interpretation,element); | ||
67766 | } | ||
67767 | |||
67768 | private pattern elementCloseWorld(element:DefinedElement) { | ||
67769 | PartialInterpretation.openWorldElements(i,element); | ||
67770 | PartialInterpretation.maxNewElements(i,0); | ||
67771 | } or { | ||
67772 | Scope.targetTypeInterpretation(scope,interpretation); | ||
67773 | PartialTypeInterpratation.elements(interpretation,element); | ||
67774 | Scope.maxNewElements(scope,0); | ||
67775 | } | ||
67776 | |||
67777 | //////////////////////// | ||
67778 | // 0.2 Equivalence | ||
67779 | //////////////////////// | ||
67780 | pattern mayEquivalent(problem:LogicProblem, interpretation:PartialInterpretation, a: DefinedElement, b: DefinedElement) { | ||
67781 | find mayExist(problem,interpretation,a); | ||
67782 | find mayExist(problem,interpretation,b); | ||
67783 | a == b; | ||
67784 | } | ||
67785 | |||
67786 | //////////////////////// | ||
67787 | // 0.3 Required Patterns by TypeIndexer | ||
67788 | //////////////////////// | ||
67789 | private pattern typeInterpretation(problem:LogicProblem, interpretation:PartialInterpretation, type:TypeDeclaration, typeInterpretation:PartialComplexTypeInterpretation) { | ||
67790 | find interpretation(problem,interpretation); | ||
67791 | LogicProblem.types(problem,type); | ||
67792 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
67793 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
67794 | } | ||
67795 | |||
67796 | private pattern directInstanceOf(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement, type:Type) { | ||
67797 | find interpretation(problem,interpretation); | ||
67798 | LogicProblem.types(problem,type); | ||
67799 | TypeDefinition.elements(type,element); | ||
67800 | } or { | ||
67801 | find interpretation(problem,interpretation); | ||
67802 | find typeInterpretation(problem,interpretation,type,typeInterpretation); | ||
67803 | PartialComplexTypeInterpretation.elements(typeInterpretation,element); | ||
67804 | } | ||
67805 | |||
67806 | private pattern isPrimitive(element: PrimitiveElement) { | ||
67807 | PrimitiveElement(element); | ||
67808 | } | ||
67809 | |||
67810 | ////////// | ||
67811 | // 1. Problem-Specific Base Indexers | ||
67812 | ////////// | ||
67813 | // 1.1 Type Indexers | ||
67814 | ////////// | ||
67815 | // 1.1.1 primitive Type Indexers | ||
67816 | ////////// | ||
67817 | |||
67818 | ////////// | ||
67819 | // 1.1.2 domain-specific Type Indexers | ||
67820 | ////////// | ||
67821 | /** | ||
67822 | * An element must be an instance of type "FunctionalElement class". | ||
67823 | */ | ||
67824 | private pattern mustInstanceOfFunctionalElement_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
67825 | Type.name(type,"FunctionalElement class"); | ||
67826 | find directInstanceOf(problem,interpretation,element,type); | ||
67827 | } | ||
67828 | private pattern scopeDisallowsNewFunctionalElement_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
67829 | find interpretation(problem,interpretation); | ||
67830 | PartialInterpretation.scopes(interpretation,scope); | ||
67831 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
67832 | Scope.maxNewElements(scope,0); | ||
67833 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
67834 | Type.name(type,"FunctionalElement class"); | ||
67835 | } | ||
67836 | |||
67837 | /** | ||
67838 | * An element may be an instance of type "FunctionalElement class". | ||
67839 | */ | ||
67840 | private pattern mayInstanceOfFunctionalElement_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
67841 | { | ||
67842 | find interpretation(problem,interpretation); | ||
67843 | PartialInterpretation.newElements(interpretation,element); | ||
67844 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
67845 | neg find mustInstanceOfFunction_class(problem,interpretation,element); | ||
67846 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
67847 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
67848 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
67849 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
67850 | neg find scopeDisallowsNewFunctionalElement_class(problem, interpretation); | ||
67851 | neg find isPrimitive(element); | ||
67852 | } or { | ||
67853 | find interpretation(problem,interpretation); | ||
67854 | PartialInterpretation.openWorldElements(interpretation,element); | ||
67855 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
67856 | neg find mustInstanceOfFunction_class(problem,interpretation,element); | ||
67857 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
67858 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
67859 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
67860 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
67861 | neg find scopeDisallowsNewFunctionalElement_class(problem, interpretation); | ||
67862 | neg find isPrimitive(element); | ||
67863 | } or | ||
67864 | { find mustInstanceOfFunctionalElement_class(problem,interpretation,element); } | ||
67865 | /** | ||
67866 | * An element must be an instance of type "FunctionalArchitectureModel class". | ||
67867 | */ | ||
67868 | private pattern mustInstanceOfFunctionalArchitectureModel_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
67869 | Type.name(type,"FunctionalArchitectureModel class"); | ||
67870 | find directInstanceOf(problem,interpretation,element,type); | ||
67871 | } | ||
67872 | private pattern scopeDisallowsNewFunctionalArchitectureModel_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
67873 | find interpretation(problem,interpretation); | ||
67874 | PartialInterpretation.scopes(interpretation,scope); | ||
67875 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
67876 | Scope.maxNewElements(scope,0); | ||
67877 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
67878 | Type.name(type,"FunctionalArchitectureModel class"); | ||
67879 | } | ||
67880 | |||
67881 | /** | ||
67882 | * An element may be an instance of type "FunctionalArchitectureModel class". | ||
67883 | */ | ||
67884 | private pattern mayInstanceOfFunctionalArchitectureModel_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
67885 | { | ||
67886 | find interpretation(problem,interpretation); | ||
67887 | PartialInterpretation.newElements(interpretation,element); | ||
67888 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
67889 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
67890 | neg find mustInstanceOfFunctionalArchitectureModel_class_UndefinedPart(problem,interpretation,element); | ||
67891 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
67892 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
67893 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
67894 | neg find scopeDisallowsNewFunctionalArchitectureModel_class(problem, interpretation); | ||
67895 | neg find isPrimitive(element); | ||
67896 | } or { | ||
67897 | find interpretation(problem,interpretation); | ||
67898 | PartialInterpretation.openWorldElements(interpretation,element); | ||
67899 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
67900 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
67901 | neg find mustInstanceOfFunctionalArchitectureModel_class_UndefinedPart(problem,interpretation,element); | ||
67902 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
67903 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
67904 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
67905 | neg find scopeDisallowsNewFunctionalArchitectureModel_class(problem, interpretation); | ||
67906 | neg find isPrimitive(element); | ||
67907 | } or | ||
67908 | { find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); } | ||
67909 | /** | ||
67910 | * An element must be an instance of type "Function class". | ||
67911 | */ | ||
67912 | private pattern mustInstanceOfFunction_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
67913 | Type.name(type,"Function class"); | ||
67914 | find directInstanceOf(problem,interpretation,element,type); | ||
67915 | } | ||
67916 | private pattern scopeDisallowsNewFunction_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
67917 | find interpretation(problem,interpretation); | ||
67918 | PartialInterpretation.scopes(interpretation,scope); | ||
67919 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
67920 | Scope.maxNewElements(scope,0); | ||
67921 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
67922 | Type.name(type,"Function class"); | ||
67923 | } | ||
67924 | |||
67925 | /** | ||
67926 | * An element may be an instance of type "Function class". | ||
67927 | */ | ||
67928 | private pattern mayInstanceOfFunction_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
67929 | { | ||
67930 | find interpretation(problem,interpretation); | ||
67931 | PartialInterpretation.newElements(interpretation,element); | ||
67932 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
67933 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
67934 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
67935 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
67936 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
67937 | neg find scopeDisallowsNewFunction_class(problem, interpretation); | ||
67938 | neg find isPrimitive(element); | ||
67939 | } or { | ||
67940 | find interpretation(problem,interpretation); | ||
67941 | PartialInterpretation.openWorldElements(interpretation,element); | ||
67942 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
67943 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
67944 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
67945 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
67946 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
67947 | neg find scopeDisallowsNewFunction_class(problem, interpretation); | ||
67948 | neg find isPrimitive(element); | ||
67949 | } or | ||
67950 | { find mustInstanceOfFunction_class(problem,interpretation,element); } | ||
67951 | /** | ||
67952 | * An element must be an instance of type "FAMTerminator class". | ||
67953 | */ | ||
67954 | private pattern mustInstanceOfFAMTerminator_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
67955 | Type.name(type,"FAMTerminator class"); | ||
67956 | find directInstanceOf(problem,interpretation,element,type); | ||
67957 | } | ||
67958 | private pattern scopeDisallowsNewFAMTerminator_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
67959 | find interpretation(problem,interpretation); | ||
67960 | PartialInterpretation.scopes(interpretation,scope); | ||
67961 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
67962 | Scope.maxNewElements(scope,0); | ||
67963 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
67964 | Type.name(type,"FAMTerminator class"); | ||
67965 | } | ||
67966 | |||
67967 | /** | ||
67968 | * An element may be an instance of type "FAMTerminator class". | ||
67969 | */ | ||
67970 | private pattern mayInstanceOfFAMTerminator_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
67971 | { | ||
67972 | find interpretation(problem,interpretation); | ||
67973 | PartialInterpretation.newElements(interpretation,element); | ||
67974 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
67975 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
67976 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
67977 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
67978 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
67979 | neg find scopeDisallowsNewFAMTerminator_class(problem, interpretation); | ||
67980 | neg find isPrimitive(element); | ||
67981 | } or { | ||
67982 | find interpretation(problem,interpretation); | ||
67983 | PartialInterpretation.openWorldElements(interpretation,element); | ||
67984 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
67985 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
67986 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
67987 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
67988 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
67989 | neg find scopeDisallowsNewFAMTerminator_class(problem, interpretation); | ||
67990 | neg find isPrimitive(element); | ||
67991 | } or | ||
67992 | { find mustInstanceOfFAMTerminator_class(problem,interpretation,element); } | ||
67993 | /** | ||
67994 | * An element must be an instance of type "InformationLink class". | ||
67995 | */ | ||
67996 | private pattern mustInstanceOfInformationLink_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
67997 | Type.name(type,"InformationLink class"); | ||
67998 | find directInstanceOf(problem,interpretation,element,type); | ||
67999 | } | ||
68000 | private pattern scopeDisallowsNewInformationLink_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
68001 | find interpretation(problem,interpretation); | ||
68002 | PartialInterpretation.scopes(interpretation,scope); | ||
68003 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
68004 | Scope.maxNewElements(scope,0); | ||
68005 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
68006 | Type.name(type,"InformationLink class"); | ||
68007 | } | ||
68008 | |||
68009 | /** | ||
68010 | * An element may be an instance of type "InformationLink class". | ||
68011 | */ | ||
68012 | private pattern mayInstanceOfInformationLink_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
68013 | { | ||
68014 | find interpretation(problem,interpretation); | ||
68015 | PartialInterpretation.newElements(interpretation,element); | ||
68016 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
68017 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
68018 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
68019 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
68020 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
68021 | neg find scopeDisallowsNewInformationLink_class(problem, interpretation); | ||
68022 | neg find isPrimitive(element); | ||
68023 | } or { | ||
68024 | find interpretation(problem,interpretation); | ||
68025 | PartialInterpretation.openWorldElements(interpretation,element); | ||
68026 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
68027 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
68028 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
68029 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
68030 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
68031 | neg find scopeDisallowsNewInformationLink_class(problem, interpretation); | ||
68032 | neg find isPrimitive(element); | ||
68033 | } or | ||
68034 | { find mustInstanceOfInformationLink_class(problem,interpretation,element); } | ||
68035 | /** | ||
68036 | * An element must be an instance of type "FunctionalInterface class". | ||
68037 | */ | ||
68038 | private pattern mustInstanceOfFunctionalInterface_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
68039 | Type.name(type,"FunctionalInterface class"); | ||
68040 | find directInstanceOf(problem,interpretation,element,type); | ||
68041 | } | ||
68042 | private pattern scopeDisallowsNewFunctionalInterface_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
68043 | find interpretation(problem,interpretation); | ||
68044 | PartialInterpretation.scopes(interpretation,scope); | ||
68045 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
68046 | Scope.maxNewElements(scope,0); | ||
68047 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
68048 | Type.name(type,"FunctionalInterface class"); | ||
68049 | } | ||
68050 | |||
68051 | /** | ||
68052 | * An element may be an instance of type "FunctionalInterface class". | ||
68053 | */ | ||
68054 | private pattern mayInstanceOfFunctionalInterface_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
68055 | { | ||
68056 | find interpretation(problem,interpretation); | ||
68057 | PartialInterpretation.newElements(interpretation,element); | ||
68058 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
68059 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
68060 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
68061 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
68062 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
68063 | neg find scopeDisallowsNewFunctionalInterface_class(problem, interpretation); | ||
68064 | neg find isPrimitive(element); | ||
68065 | } or { | ||
68066 | find interpretation(problem,interpretation); | ||
68067 | PartialInterpretation.openWorldElements(interpretation,element); | ||
68068 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
68069 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
68070 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
68071 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
68072 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
68073 | neg find scopeDisallowsNewFunctionalInterface_class(problem, interpretation); | ||
68074 | neg find isPrimitive(element); | ||
68075 | } or | ||
68076 | { find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); } | ||
68077 | /** | ||
68078 | * An element must be an instance of type "FunctionalInput class". | ||
68079 | */ | ||
68080 | private pattern mustInstanceOfFunctionalInput_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
68081 | Type.name(type,"FunctionalInput class"); | ||
68082 | find directInstanceOf(problem,interpretation,element,type); | ||
68083 | } | ||
68084 | private pattern scopeDisallowsNewFunctionalInput_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
68085 | find interpretation(problem,interpretation); | ||
68086 | PartialInterpretation.scopes(interpretation,scope); | ||
68087 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
68088 | Scope.maxNewElements(scope,0); | ||
68089 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
68090 | Type.name(type,"FunctionalInput class"); | ||
68091 | } | ||
68092 | |||
68093 | /** | ||
68094 | * An element may be an instance of type "FunctionalInput class". | ||
68095 | */ | ||
68096 | private pattern mayInstanceOfFunctionalInput_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
68097 | { | ||
68098 | find interpretation(problem,interpretation); | ||
68099 | PartialInterpretation.newElements(interpretation,element); | ||
68100 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
68101 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
68102 | neg find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
68103 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
68104 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
68105 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
68106 | neg find scopeDisallowsNewFunctionalInput_class(problem, interpretation); | ||
68107 | neg find isPrimitive(element); | ||
68108 | } or { | ||
68109 | find interpretation(problem,interpretation); | ||
68110 | PartialInterpretation.openWorldElements(interpretation,element); | ||
68111 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
68112 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
68113 | neg find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
68114 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
68115 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
68116 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
68117 | neg find scopeDisallowsNewFunctionalInput_class(problem, interpretation); | ||
68118 | neg find isPrimitive(element); | ||
68119 | } or | ||
68120 | { find mustInstanceOfFunctionalInput_class(problem,interpretation,element); } | ||
68121 | /** | ||
68122 | * An element must be an instance of type "FunctionalOutput class". | ||
68123 | */ | ||
68124 | private pattern mustInstanceOfFunctionalOutput_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
68125 | Type.name(type,"FunctionalOutput class"); | ||
68126 | find directInstanceOf(problem,interpretation,element,type); | ||
68127 | } | ||
68128 | private pattern scopeDisallowsNewFunctionalOutput_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
68129 | find interpretation(problem,interpretation); | ||
68130 | PartialInterpretation.scopes(interpretation,scope); | ||
68131 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
68132 | Scope.maxNewElements(scope,0); | ||
68133 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
68134 | Type.name(type,"FunctionalOutput class"); | ||
68135 | } | ||
68136 | |||
68137 | /** | ||
68138 | * An element may be an instance of type "FunctionalOutput class". | ||
68139 | */ | ||
68140 | private pattern mayInstanceOfFunctionalOutput_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
68141 | { | ||
68142 | find interpretation(problem,interpretation); | ||
68143 | PartialInterpretation.newElements(interpretation,element); | ||
68144 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
68145 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
68146 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
68147 | neg find mustInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
68148 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
68149 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
68150 | neg find scopeDisallowsNewFunctionalOutput_class(problem, interpretation); | ||
68151 | neg find isPrimitive(element); | ||
68152 | } or { | ||
68153 | find interpretation(problem,interpretation); | ||
68154 | PartialInterpretation.openWorldElements(interpretation,element); | ||
68155 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
68156 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
68157 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
68158 | neg find mustInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
68159 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
68160 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
68161 | neg find scopeDisallowsNewFunctionalOutput_class(problem, interpretation); | ||
68162 | neg find isPrimitive(element); | ||
68163 | } or | ||
68164 | { find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); } | ||
68165 | /** | ||
68166 | * An element must be an instance of type "FunctionalData class". | ||
68167 | */ | ||
68168 | private pattern mustInstanceOfFunctionalData_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
68169 | Type.name(type,"FunctionalData class"); | ||
68170 | find directInstanceOf(problem,interpretation,element,type); | ||
68171 | } | ||
68172 | private pattern scopeDisallowsNewFunctionalData_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
68173 | find interpretation(problem,interpretation); | ||
68174 | PartialInterpretation.scopes(interpretation,scope); | ||
68175 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
68176 | Scope.maxNewElements(scope,0); | ||
68177 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
68178 | Type.name(type,"FunctionalData class"); | ||
68179 | } | ||
68180 | |||
68181 | /** | ||
68182 | * An element may be an instance of type "FunctionalData class". | ||
68183 | */ | ||
68184 | private pattern mayInstanceOfFunctionalData_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
68185 | { | ||
68186 | find interpretation(problem,interpretation); | ||
68187 | PartialInterpretation.newElements(interpretation,element); | ||
68188 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
68189 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
68190 | neg find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
68191 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
68192 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
68193 | neg find mustInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
68194 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
68195 | neg find scopeDisallowsNewFunctionalData_class(problem, interpretation); | ||
68196 | neg find isPrimitive(element); | ||
68197 | } or { | ||
68198 | find interpretation(problem,interpretation); | ||
68199 | PartialInterpretation.openWorldElements(interpretation,element); | ||
68200 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
68201 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
68202 | neg find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
68203 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
68204 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
68205 | neg find mustInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
68206 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
68207 | neg find scopeDisallowsNewFunctionalData_class(problem, interpretation); | ||
68208 | neg find isPrimitive(element); | ||
68209 | } or | ||
68210 | { find mustInstanceOfFunctionalData_class(problem,interpretation,element); } | ||
68211 | /** | ||
68212 | * An element must be an instance of type "FunctionType enum". | ||
68213 | */ | ||
68214 | private pattern mustInstanceOfFunctionType_enum(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
68215 | Type.name(type,"FunctionType enum"); | ||
68216 | find directInstanceOf(problem,interpretation,element,type); | ||
68217 | } | ||
68218 | private pattern scopeDisallowsNewFunctionType_enum(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
68219 | find interpretation(problem,interpretation); | ||
68220 | PartialInterpretation.scopes(interpretation,scope); | ||
68221 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
68222 | Scope.maxNewElements(scope,0); | ||
68223 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
68224 | Type.name(type,"FunctionType enum"); | ||
68225 | } | ||
68226 | |||
68227 | /** | ||
68228 | * An element may be an instance of type "FunctionType enum". | ||
68229 | */ | ||
68230 | private pattern mayInstanceOfFunctionType_enum(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
68231 | { find mustInstanceOfFunctionType_enum(problem,interpretation,element); } | ||
68232 | /** | ||
68233 | * An element must be an instance of type "FunctionalArchitectureModel class DefinedPart". | ||
68234 | */ | ||
68235 | private pattern mustInstanceOfFunctionalArchitectureModel_class_DefinedPart(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
68236 | Type.name(type,"FunctionalArchitectureModel class DefinedPart"); | ||
68237 | find directInstanceOf(problem,interpretation,element,type); | ||
68238 | } | ||
68239 | private pattern scopeDisallowsNewFunctionalArchitectureModel_class_DefinedPart(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
68240 | find interpretation(problem,interpretation); | ||
68241 | PartialInterpretation.scopes(interpretation,scope); | ||
68242 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
68243 | Scope.maxNewElements(scope,0); | ||
68244 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
68245 | Type.name(type,"FunctionalArchitectureModel class DefinedPart"); | ||
68246 | } | ||
68247 | |||
68248 | /** | ||
68249 | * An element may be an instance of type "FunctionalArchitectureModel class DefinedPart". | ||
68250 | */ | ||
68251 | private pattern mayInstanceOfFunctionalArchitectureModel_class_DefinedPart(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
68252 | { find mustInstanceOfFunctionalArchitectureModel_class_DefinedPart(problem,interpretation,element); } | ||
68253 | /** | ||
68254 | * An element must be an instance of type "FunctionalArchitectureModel class UndefinedPart". | ||
68255 | */ | ||
68256 | private pattern mustInstanceOfFunctionalArchitectureModel_class_UndefinedPart(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
68257 | Type.name(type,"FunctionalArchitectureModel class UndefinedPart"); | ||
68258 | find directInstanceOf(problem,interpretation,element,type); | ||
68259 | } | ||
68260 | private pattern scopeDisallowsNewFunctionalArchitectureModel_class_UndefinedPart(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
68261 | find interpretation(problem,interpretation); | ||
68262 | PartialInterpretation.scopes(interpretation,scope); | ||
68263 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
68264 | Scope.maxNewElements(scope,0); | ||
68265 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
68266 | Type.name(type,"FunctionalArchitectureModel class UndefinedPart"); | ||
68267 | } | ||
68268 | |||
68269 | /** | ||
68270 | * An element may be an instance of type "FunctionalArchitectureModel class UndefinedPart". | ||
68271 | */ | ||
68272 | private pattern mayInstanceOfFunctionalArchitectureModel_class_UndefinedPart(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
68273 | { | ||
68274 | find interpretation(problem,interpretation); | ||
68275 | PartialInterpretation.newElements(interpretation,element); | ||
68276 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
68277 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
68278 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
68279 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
68280 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
68281 | neg find scopeDisallowsNewFunctionalArchitectureModel_class_UndefinedPart(problem, interpretation); | ||
68282 | neg find isPrimitive(element); | ||
68283 | } or { | ||
68284 | find interpretation(problem,interpretation); | ||
68285 | PartialInterpretation.openWorldElements(interpretation,element); | ||
68286 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
68287 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
68288 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
68289 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
68290 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
68291 | neg find scopeDisallowsNewFunctionalArchitectureModel_class_UndefinedPart(problem, interpretation); | ||
68292 | neg find isPrimitive(element); | ||
68293 | } or | ||
68294 | { find mustInstanceOfFunctionalArchitectureModel_class_UndefinedPart(problem,interpretation,element); } | ||
68295 | |||
68296 | ////////// | ||
68297 | // 1.2 Relation Declaration Indexers | ||
68298 | ////////// | ||
68299 | /** | ||
68300 | * Matcher for detecting tuples t where []interface reference FunctionalElement(source,target) | ||
68301 | */ | ||
68302 | private pattern mustInRelationinterface_reference_FunctionalElement( | ||
68303 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
68304 | source: DefinedElement, target:DefinedElement) | ||
68305 | { | ||
68306 | find interpretation(problem,interpretation); | ||
68307 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
68308 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"interface reference FunctionalElement"); | ||
68309 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
68310 | BinaryElementRelationLink.param1(link,source); | ||
68311 | BinaryElementRelationLink.param2(link,target); | ||
68312 | } | ||
68313 | /** | ||
68314 | * Matcher for detecting tuples t where <>interface reference FunctionalElement(source,target) | ||
68315 | */ | ||
68316 | private pattern mayInRelationinterface_reference_FunctionalElement( | ||
68317 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
68318 | source: DefinedElement, target:DefinedElement) | ||
68319 | { | ||
68320 | find interpretation(problem,interpretation); | ||
68321 | // The two endpoint of the link have to exist | ||
68322 | find mayExist(problem, interpretation, source); | ||
68323 | find mayExist(problem, interpretation, target); | ||
68324 | // Type consistency | ||
68325 | find mayInstanceOfFunctionalElement_class(problem,interpretation,source); | ||
68326 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,target); | ||
68327 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
68328 | // the upper bound of the multiplicity should be considered. | ||
68329 | numberOfExistingReferences == count find mustInRelationinterface_reference_FunctionalElement(problem,interpretation,source,_); | ||
68330 | check(numberOfExistingReferences < 1); | ||
68331 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
68332 | // the upper bound of the opposite reference multiplicity should be considered. | ||
68333 | numberOfExistingOppositeReferences == count find mustInRelationelement_reference_FunctionalInterface(problem,interpretation,target,_); | ||
68334 | check(numberOfExistingOppositeReferences < 1); | ||
68335 | // The reference is containment, then a new reference cannot be create if: | ||
68336 | // 1. Multiple parents | ||
68337 | neg find mustContains4(problem,interpretation,_,target); | ||
68338 | // 2. Circle in the containment hierarchy | ||
68339 | neg find mustTransitiveContains(source,target); | ||
68340 | } or { | ||
68341 | find mustInRelationinterface_reference_FunctionalElement(problem,interpretation,source,target); | ||
68342 | } | ||
68343 | /** | ||
68344 | * Matcher for detecting tuples t where []model reference FunctionalElement(source,target) | ||
68345 | */ | ||
68346 | private pattern mustInRelationmodel_reference_FunctionalElement( | ||
68347 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
68348 | source: DefinedElement, target:DefinedElement) | ||
68349 | { | ||
68350 | find interpretation(problem,interpretation); | ||
68351 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
68352 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"model reference FunctionalElement"); | ||
68353 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
68354 | BinaryElementRelationLink.param1(link,source); | ||
68355 | BinaryElementRelationLink.param2(link,target); | ||
68356 | } | ||
68357 | /** | ||
68358 | * Matcher for detecting tuples t where <>model reference FunctionalElement(source,target) | ||
68359 | */ | ||
68360 | private pattern mayInRelationmodel_reference_FunctionalElement( | ||
68361 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
68362 | source: DefinedElement, target:DefinedElement) | ||
68363 | { | ||
68364 | find interpretation(problem,interpretation); | ||
68365 | // The two endpoint of the link have to exist | ||
68366 | find mayExist(problem, interpretation, source); | ||
68367 | find mayExist(problem, interpretation, target); | ||
68368 | // Type consistency | ||
68369 | find mayInstanceOfFunctionalElement_class(problem,interpretation,source); | ||
68370 | find mayInstanceOfFunctionalArchitectureModel_class(problem,interpretation,target); | ||
68371 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
68372 | // the upper bound of the multiplicity should be considered. | ||
68373 | numberOfExistingReferences == count find mustInRelationmodel_reference_FunctionalElement(problem,interpretation,source,_); | ||
68374 | check(numberOfExistingReferences < 1); | ||
68375 | } or { | ||
68376 | find mustInRelationmodel_reference_FunctionalElement(problem,interpretation,source,target); | ||
68377 | } | ||
68378 | /** | ||
68379 | * Matcher for detecting tuples t where []parent reference FunctionalElement(source,target) | ||
68380 | */ | ||
68381 | private pattern mustInRelationparent_reference_FunctionalElement( | ||
68382 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
68383 | source: DefinedElement, target:DefinedElement) | ||
68384 | { | ||
68385 | find interpretation(problem,interpretation); | ||
68386 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
68387 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"parent reference FunctionalElement"); | ||
68388 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
68389 | BinaryElementRelationLink.param1(link,source); | ||
68390 | BinaryElementRelationLink.param2(link,target); | ||
68391 | } | ||
68392 | /** | ||
68393 | * Matcher for detecting tuples t where <>parent reference FunctionalElement(source,target) | ||
68394 | */ | ||
68395 | private pattern mayInRelationparent_reference_FunctionalElement( | ||
68396 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
68397 | source: DefinedElement, target:DefinedElement) | ||
68398 | { | ||
68399 | find interpretation(problem,interpretation); | ||
68400 | // The two endpoint of the link have to exist | ||
68401 | find mayExist(problem, interpretation, source); | ||
68402 | find mayExist(problem, interpretation, target); | ||
68403 | // Type consistency | ||
68404 | find mayInstanceOfFunctionalElement_class(problem,interpretation,source); | ||
68405 | find mayInstanceOfFunction_class(problem,interpretation,target); | ||
68406 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
68407 | // the upper bound of the multiplicity should be considered. | ||
68408 | numberOfExistingReferences == count find mustInRelationparent_reference_FunctionalElement(problem,interpretation,source,_); | ||
68409 | check(numberOfExistingReferences < 1); | ||
68410 | // The eOpposite of the reference is containment, then a referene cannot be created if | ||
68411 | // 1. Multiple parents | ||
68412 | neg find mustContains4(problem,interpretation,source,_); | ||
68413 | // 2. Circle in the containment hierarchy | ||
68414 | neg find mustTransitiveContains(source,target); | ||
68415 | } or { | ||
68416 | find mustInRelationparent_reference_FunctionalElement(problem,interpretation,source,target); | ||
68417 | } | ||
68418 | /** | ||
68419 | * Matcher for detecting tuples t where []rootElements reference FunctionalArchitectureModel(source,target) | ||
68420 | */ | ||
68421 | private pattern mustInRelationrootElements_reference_FunctionalArchitectureModel( | ||
68422 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
68423 | source: DefinedElement, target:DefinedElement) | ||
68424 | { | ||
68425 | find interpretation(problem,interpretation); | ||
68426 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
68427 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"rootElements reference FunctionalArchitectureModel"); | ||
68428 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
68429 | BinaryElementRelationLink.param1(link,source); | ||
68430 | BinaryElementRelationLink.param2(link,target); | ||
68431 | } | ||
68432 | /** | ||
68433 | * Matcher for detecting tuples t where <>rootElements reference FunctionalArchitectureModel(source,target) | ||
68434 | */ | ||
68435 | private pattern mayInRelationrootElements_reference_FunctionalArchitectureModel( | ||
68436 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
68437 | source: DefinedElement, target:DefinedElement) | ||
68438 | { | ||
68439 | find interpretation(problem,interpretation); | ||
68440 | // The two endpoint of the link have to exist | ||
68441 | find mayExist(problem, interpretation, source); | ||
68442 | find mayExist(problem, interpretation, target); | ||
68443 | // Type consistency | ||
68444 | find mayInstanceOfFunctionalArchitectureModel_class(problem,interpretation,source); | ||
68445 | find mayInstanceOfFunctionalElement_class(problem,interpretation,target); | ||
68446 | // The reference is containment, then a new reference cannot be create if: | ||
68447 | // 1. Multiple parents | ||
68448 | neg find mustContains4(problem,interpretation,_,target); | ||
68449 | // 2. Circle in the containment hierarchy | ||
68450 | neg find mustTransitiveContains(source,target); | ||
68451 | } or { | ||
68452 | find mustInRelationrootElements_reference_FunctionalArchitectureModel(problem,interpretation,source,target); | ||
68453 | } | ||
68454 | /** | ||
68455 | * Matcher for detecting tuples t where []subElements reference Function(source,target) | ||
68456 | */ | ||
68457 | private pattern mustInRelationsubElements_reference_Function( | ||
68458 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
68459 | source: DefinedElement, target:DefinedElement) | ||
68460 | { | ||
68461 | find interpretation(problem,interpretation); | ||
68462 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
68463 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"subElements reference Function"); | ||
68464 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
68465 | BinaryElementRelationLink.param1(link,source); | ||
68466 | BinaryElementRelationLink.param2(link,target); | ||
68467 | } | ||
68468 | /** | ||
68469 | * Matcher for detecting tuples t where <>subElements reference Function(source,target) | ||
68470 | */ | ||
68471 | private pattern mayInRelationsubElements_reference_Function( | ||
68472 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
68473 | source: DefinedElement, target:DefinedElement) | ||
68474 | { | ||
68475 | find interpretation(problem,interpretation); | ||
68476 | // The two endpoint of the link have to exist | ||
68477 | find mayExist(problem, interpretation, source); | ||
68478 | find mayExist(problem, interpretation, target); | ||
68479 | // Type consistency | ||
68480 | find mayInstanceOfFunction_class(problem,interpretation,source); | ||
68481 | find mayInstanceOfFunctionalElement_class(problem,interpretation,target); | ||
68482 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
68483 | // the upper bound of the opposite reference multiplicity should be considered. | ||
68484 | numberOfExistingOppositeReferences == count find mustInRelationparent_reference_FunctionalElement(problem,interpretation,target,_); | ||
68485 | check(numberOfExistingOppositeReferences < 1); | ||
68486 | // The reference is containment, then a new reference cannot be create if: | ||
68487 | // 1. Multiple parents | ||
68488 | neg find mustContains4(problem,interpretation,_,target); | ||
68489 | // 2. Circle in the containment hierarchy | ||
68490 | neg find mustTransitiveContains(source,target); | ||
68491 | } or { | ||
68492 | find mustInRelationsubElements_reference_Function(problem,interpretation,source,target); | ||
68493 | } | ||
68494 | /** | ||
68495 | * Matcher for detecting tuples t where []data reference FAMTerminator(source,target) | ||
68496 | */ | ||
68497 | private pattern mustInRelationdata_reference_FAMTerminator( | ||
68498 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
68499 | source: DefinedElement, target:DefinedElement) | ||
68500 | { | ||
68501 | find interpretation(problem,interpretation); | ||
68502 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
68503 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"data reference FAMTerminator"); | ||
68504 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
68505 | BinaryElementRelationLink.param1(link,source); | ||
68506 | BinaryElementRelationLink.param2(link,target); | ||
68507 | } | ||
68508 | /** | ||
68509 | * Matcher for detecting tuples t where <>data reference FAMTerminator(source,target) | ||
68510 | */ | ||
68511 | private pattern mayInRelationdata_reference_FAMTerminator( | ||
68512 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
68513 | source: DefinedElement, target:DefinedElement) | ||
68514 | { | ||
68515 | find interpretation(problem,interpretation); | ||
68516 | // The two endpoint of the link have to exist | ||
68517 | find mayExist(problem, interpretation, source); | ||
68518 | find mayExist(problem, interpretation, target); | ||
68519 | // Type consistency | ||
68520 | find mayInstanceOfFAMTerminator_class(problem,interpretation,source); | ||
68521 | find mayInstanceOfFunctionalData_class(problem,interpretation,target); | ||
68522 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
68523 | // the upper bound of the multiplicity should be considered. | ||
68524 | numberOfExistingReferences == count find mustInRelationdata_reference_FAMTerminator(problem,interpretation,source,_); | ||
68525 | check(numberOfExistingReferences < 1); | ||
68526 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
68527 | // the upper bound of the opposite reference multiplicity should be considered. | ||
68528 | numberOfExistingOppositeReferences == count find mustInRelationterminator_reference_FunctionalData(problem,interpretation,target,_); | ||
68529 | check(numberOfExistingOppositeReferences < 1); | ||
68530 | // The eOpposite of the reference is containment, then a referene cannot be created if | ||
68531 | // 1. Multiple parents | ||
68532 | neg find mustContains4(problem,interpretation,source,_); | ||
68533 | // 2. Circle in the containment hierarchy | ||
68534 | neg find mustTransitiveContains(source,target); | ||
68535 | } or { | ||
68536 | find mustInRelationdata_reference_FAMTerminator(problem,interpretation,source,target); | ||
68537 | } | ||
68538 | /** | ||
68539 | * Matcher for detecting tuples t where []from reference InformationLink(source,target) | ||
68540 | */ | ||
68541 | private pattern mustInRelationfrom_reference_InformationLink( | ||
68542 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
68543 | source: DefinedElement, target:DefinedElement) | ||
68544 | { | ||
68545 | find interpretation(problem,interpretation); | ||
68546 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
68547 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"from reference InformationLink"); | ||
68548 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
68549 | BinaryElementRelationLink.param1(link,source); | ||
68550 | BinaryElementRelationLink.param2(link,target); | ||
68551 | } | ||
68552 | /** | ||
68553 | * Matcher for detecting tuples t where <>from reference InformationLink(source,target) | ||
68554 | */ | ||
68555 | private pattern mayInRelationfrom_reference_InformationLink( | ||
68556 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
68557 | source: DefinedElement, target:DefinedElement) | ||
68558 | { | ||
68559 | find interpretation(problem,interpretation); | ||
68560 | // The two endpoint of the link have to exist | ||
68561 | find mayExist(problem, interpretation, source); | ||
68562 | find mayExist(problem, interpretation, target); | ||
68563 | // Type consistency | ||
68564 | find mayInstanceOfInformationLink_class(problem,interpretation,source); | ||
68565 | find mayInstanceOfFunctionalOutput_class(problem,interpretation,target); | ||
68566 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
68567 | // the upper bound of the multiplicity should be considered. | ||
68568 | numberOfExistingReferences == count find mustInRelationfrom_reference_InformationLink(problem,interpretation,source,_); | ||
68569 | check(numberOfExistingReferences < 1); | ||
68570 | // The eOpposite of the reference is containment, then a referene cannot be created if | ||
68571 | // 1. Multiple parents | ||
68572 | neg find mustContains4(problem,interpretation,source,_); | ||
68573 | // 2. Circle in the containment hierarchy | ||
68574 | neg find mustTransitiveContains(source,target); | ||
68575 | } or { | ||
68576 | find mustInRelationfrom_reference_InformationLink(problem,interpretation,source,target); | ||
68577 | } | ||
68578 | /** | ||
68579 | * Matcher for detecting tuples t where []to reference InformationLink(source,target) | ||
68580 | */ | ||
68581 | private pattern mustInRelationto_reference_InformationLink( | ||
68582 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
68583 | source: DefinedElement, target:DefinedElement) | ||
68584 | { | ||
68585 | find interpretation(problem,interpretation); | ||
68586 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
68587 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"to reference InformationLink"); | ||
68588 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
68589 | BinaryElementRelationLink.param1(link,source); | ||
68590 | BinaryElementRelationLink.param2(link,target); | ||
68591 | } | ||
68592 | /** | ||
68593 | * Matcher for detecting tuples t where <>to reference InformationLink(source,target) | ||
68594 | */ | ||
68595 | private pattern mayInRelationto_reference_InformationLink( | ||
68596 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
68597 | source: DefinedElement, target:DefinedElement) | ||
68598 | { | ||
68599 | find interpretation(problem,interpretation); | ||
68600 | // The two endpoint of the link have to exist | ||
68601 | find mayExist(problem, interpretation, source); | ||
68602 | find mayExist(problem, interpretation, target); | ||
68603 | // Type consistency | ||
68604 | find mayInstanceOfInformationLink_class(problem,interpretation,source); | ||
68605 | find mayInstanceOfFunctionalInput_class(problem,interpretation,target); | ||
68606 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
68607 | // the upper bound of the multiplicity should be considered. | ||
68608 | numberOfExistingReferences == count find mustInRelationto_reference_InformationLink(problem,interpretation,source,_); | ||
68609 | check(numberOfExistingReferences < 1); | ||
68610 | } or { | ||
68611 | find mustInRelationto_reference_InformationLink(problem,interpretation,source,target); | ||
68612 | } | ||
68613 | /** | ||
68614 | * Matcher for detecting tuples t where []data reference FunctionalInterface(source,target) | ||
68615 | */ | ||
68616 | private pattern mustInRelationdata_reference_FunctionalInterface( | ||
68617 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
68618 | source: DefinedElement, target:DefinedElement) | ||
68619 | { | ||
68620 | find interpretation(problem,interpretation); | ||
68621 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
68622 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"data reference FunctionalInterface"); | ||
68623 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
68624 | BinaryElementRelationLink.param1(link,source); | ||
68625 | BinaryElementRelationLink.param2(link,target); | ||
68626 | } | ||
68627 | /** | ||
68628 | * Matcher for detecting tuples t where <>data reference FunctionalInterface(source,target) | ||
68629 | */ | ||
68630 | private pattern mayInRelationdata_reference_FunctionalInterface( | ||
68631 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
68632 | source: DefinedElement, target:DefinedElement) | ||
68633 | { | ||
68634 | find interpretation(problem,interpretation); | ||
68635 | // The two endpoint of the link have to exist | ||
68636 | find mayExist(problem, interpretation, source); | ||
68637 | find mayExist(problem, interpretation, target); | ||
68638 | // Type consistency | ||
68639 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,source); | ||
68640 | find mayInstanceOfFunctionalData_class(problem,interpretation,target); | ||
68641 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
68642 | // the upper bound of the opposite reference multiplicity should be considered. | ||
68643 | numberOfExistingOppositeReferences == count find mustInRelationinterface_reference_FunctionalData(problem,interpretation,target,_); | ||
68644 | check(numberOfExistingOppositeReferences < 1); | ||
68645 | // The reference is containment, then a new reference cannot be create if: | ||
68646 | // 1. Multiple parents | ||
68647 | neg find mustContains4(problem,interpretation,_,target); | ||
68648 | // 2. Circle in the containment hierarchy | ||
68649 | neg find mustTransitiveContains(source,target); | ||
68650 | } or { | ||
68651 | find mustInRelationdata_reference_FunctionalInterface(problem,interpretation,source,target); | ||
68652 | } | ||
68653 | /** | ||
68654 | * Matcher for detecting tuples t where []element reference FunctionalInterface(source,target) | ||
68655 | */ | ||
68656 | private pattern mustInRelationelement_reference_FunctionalInterface( | ||
68657 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
68658 | source: DefinedElement, target:DefinedElement) | ||
68659 | { | ||
68660 | find interpretation(problem,interpretation); | ||
68661 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
68662 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"element reference FunctionalInterface"); | ||
68663 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
68664 | BinaryElementRelationLink.param1(link,source); | ||
68665 | BinaryElementRelationLink.param2(link,target); | ||
68666 | } | ||
68667 | /** | ||
68668 | * Matcher for detecting tuples t where <>element reference FunctionalInterface(source,target) | ||
68669 | */ | ||
68670 | private pattern mayInRelationelement_reference_FunctionalInterface( | ||
68671 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
68672 | source: DefinedElement, target:DefinedElement) | ||
68673 | { | ||
68674 | find interpretation(problem,interpretation); | ||
68675 | // The two endpoint of the link have to exist | ||
68676 | find mayExist(problem, interpretation, source); | ||
68677 | find mayExist(problem, interpretation, target); | ||
68678 | // Type consistency | ||
68679 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,source); | ||
68680 | find mayInstanceOfFunctionalElement_class(problem,interpretation,target); | ||
68681 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
68682 | // the upper bound of the multiplicity should be considered. | ||
68683 | numberOfExistingReferences == count find mustInRelationelement_reference_FunctionalInterface(problem,interpretation,source,_); | ||
68684 | check(numberOfExistingReferences < 1); | ||
68685 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
68686 | // the upper bound of the opposite reference multiplicity should be considered. | ||
68687 | numberOfExistingOppositeReferences == count find mustInRelationinterface_reference_FunctionalElement(problem,interpretation,target,_); | ||
68688 | check(numberOfExistingOppositeReferences < 1); | ||
68689 | // The eOpposite of the reference is containment, then a referene cannot be created if | ||
68690 | // 1. Multiple parents | ||
68691 | neg find mustContains4(problem,interpretation,source,_); | ||
68692 | // 2. Circle in the containment hierarchy | ||
68693 | neg find mustTransitiveContains(source,target); | ||
68694 | } or { | ||
68695 | find mustInRelationelement_reference_FunctionalInterface(problem,interpretation,source,target); | ||
68696 | } | ||
68697 | /** | ||
68698 | * Matcher for detecting tuples t where []IncomingLinks reference FunctionalInput(source,target) | ||
68699 | */ | ||
68700 | private pattern mustInRelationIncomingLinks_reference_FunctionalInput( | ||
68701 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
68702 | source: DefinedElement, target:DefinedElement) | ||
68703 | { | ||
68704 | find interpretation(problem,interpretation); | ||
68705 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
68706 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"IncomingLinks reference FunctionalInput"); | ||
68707 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
68708 | BinaryElementRelationLink.param1(link,source); | ||
68709 | BinaryElementRelationLink.param2(link,target); | ||
68710 | } | ||
68711 | /** | ||
68712 | * Matcher for detecting tuples t where <>IncomingLinks reference FunctionalInput(source,target) | ||
68713 | */ | ||
68714 | private pattern mayInRelationIncomingLinks_reference_FunctionalInput( | ||
68715 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
68716 | source: DefinedElement, target:DefinedElement) | ||
68717 | { | ||
68718 | find interpretation(problem,interpretation); | ||
68719 | // The two endpoint of the link have to exist | ||
68720 | find mayExist(problem, interpretation, source); | ||
68721 | find mayExist(problem, interpretation, target); | ||
68722 | // Type consistency | ||
68723 | find mayInstanceOfFunctionalInput_class(problem,interpretation,source); | ||
68724 | find mayInstanceOfInformationLink_class(problem,interpretation,target); | ||
68725 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
68726 | // the upper bound of the opposite reference multiplicity should be considered. | ||
68727 | numberOfExistingOppositeReferences == count find mustInRelationto_reference_InformationLink(problem,interpretation,target,_); | ||
68728 | check(numberOfExistingOppositeReferences < 1); | ||
68729 | } or { | ||
68730 | find mustInRelationIncomingLinks_reference_FunctionalInput(problem,interpretation,source,target); | ||
68731 | } | ||
68732 | /** | ||
68733 | * Matcher for detecting tuples t where []outgoingLinks reference FunctionalOutput(source,target) | ||
68734 | */ | ||
68735 | private pattern mustInRelationoutgoingLinks_reference_FunctionalOutput( | ||
68736 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
68737 | source: DefinedElement, target:DefinedElement) | ||
68738 | { | ||
68739 | find interpretation(problem,interpretation); | ||
68740 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
68741 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"outgoingLinks reference FunctionalOutput"); | ||
68742 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
68743 | BinaryElementRelationLink.param1(link,source); | ||
68744 | BinaryElementRelationLink.param2(link,target); | ||
68745 | } | ||
68746 | /** | ||
68747 | * Matcher for detecting tuples t where <>outgoingLinks reference FunctionalOutput(source,target) | ||
68748 | */ | ||
68749 | private pattern mayInRelationoutgoingLinks_reference_FunctionalOutput( | ||
68750 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
68751 | source: DefinedElement, target:DefinedElement) | ||
68752 | { | ||
68753 | find interpretation(problem,interpretation); | ||
68754 | // The two endpoint of the link have to exist | ||
68755 | find mayExist(problem, interpretation, source); | ||
68756 | find mayExist(problem, interpretation, target); | ||
68757 | // Type consistency | ||
68758 | find mayInstanceOfFunctionalOutput_class(problem,interpretation,source); | ||
68759 | find mayInstanceOfInformationLink_class(problem,interpretation,target); | ||
68760 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
68761 | // the upper bound of the opposite reference multiplicity should be considered. | ||
68762 | numberOfExistingOppositeReferences == count find mustInRelationfrom_reference_InformationLink(problem,interpretation,target,_); | ||
68763 | check(numberOfExistingOppositeReferences < 1); | ||
68764 | // The reference is containment, then a new reference cannot be create if: | ||
68765 | // 1. Multiple parents | ||
68766 | neg find mustContains4(problem,interpretation,_,target); | ||
68767 | // 2. Circle in the containment hierarchy | ||
68768 | neg find mustTransitiveContains(source,target); | ||
68769 | } or { | ||
68770 | find mustInRelationoutgoingLinks_reference_FunctionalOutput(problem,interpretation,source,target); | ||
68771 | } | ||
68772 | /** | ||
68773 | * Matcher for detecting tuples t where []terminator reference FunctionalData(source,target) | ||
68774 | */ | ||
68775 | private pattern mustInRelationterminator_reference_FunctionalData( | ||
68776 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
68777 | source: DefinedElement, target:DefinedElement) | ||
68778 | { | ||
68779 | find interpretation(problem,interpretation); | ||
68780 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
68781 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"terminator reference FunctionalData"); | ||
68782 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
68783 | BinaryElementRelationLink.param1(link,source); | ||
68784 | BinaryElementRelationLink.param2(link,target); | ||
68785 | } | ||
68786 | /** | ||
68787 | * Matcher for detecting tuples t where <>terminator reference FunctionalData(source,target) | ||
68788 | */ | ||
68789 | private pattern mayInRelationterminator_reference_FunctionalData( | ||
68790 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
68791 | source: DefinedElement, target:DefinedElement) | ||
68792 | { | ||
68793 | find interpretation(problem,interpretation); | ||
68794 | // The two endpoint of the link have to exist | ||
68795 | find mayExist(problem, interpretation, source); | ||
68796 | find mayExist(problem, interpretation, target); | ||
68797 | // Type consistency | ||
68798 | find mayInstanceOfFunctionalData_class(problem,interpretation,source); | ||
68799 | find mayInstanceOfFAMTerminator_class(problem,interpretation,target); | ||
68800 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
68801 | // the upper bound of the multiplicity should be considered. | ||
68802 | numberOfExistingReferences == count find mustInRelationterminator_reference_FunctionalData(problem,interpretation,source,_); | ||
68803 | check(numberOfExistingReferences < 1); | ||
68804 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
68805 | // the upper bound of the opposite reference multiplicity should be considered. | ||
68806 | numberOfExistingOppositeReferences == count find mustInRelationdata_reference_FAMTerminator(problem,interpretation,target,_); | ||
68807 | check(numberOfExistingOppositeReferences < 1); | ||
68808 | // The reference is containment, then a new reference cannot be create if: | ||
68809 | // 1. Multiple parents | ||
68810 | neg find mustContains4(problem,interpretation,_,target); | ||
68811 | // 2. Circle in the containment hierarchy | ||
68812 | neg find mustTransitiveContains(source,target); | ||
68813 | } or { | ||
68814 | find mustInRelationterminator_reference_FunctionalData(problem,interpretation,source,target); | ||
68815 | } | ||
68816 | /** | ||
68817 | * Matcher for detecting tuples t where []interface reference FunctionalData(source,target) | ||
68818 | */ | ||
68819 | private pattern mustInRelationinterface_reference_FunctionalData( | ||
68820 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
68821 | source: DefinedElement, target:DefinedElement) | ||
68822 | { | ||
68823 | find interpretation(problem,interpretation); | ||
68824 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
68825 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"interface reference FunctionalData"); | ||
68826 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
68827 | BinaryElementRelationLink.param1(link,source); | ||
68828 | BinaryElementRelationLink.param2(link,target); | ||
68829 | } | ||
68830 | /** | ||
68831 | * Matcher for detecting tuples t where <>interface reference FunctionalData(source,target) | ||
68832 | */ | ||
68833 | private pattern mayInRelationinterface_reference_FunctionalData( | ||
68834 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
68835 | source: DefinedElement, target:DefinedElement) | ||
68836 | { | ||
68837 | find interpretation(problem,interpretation); | ||
68838 | // The two endpoint of the link have to exist | ||
68839 | find mayExist(problem, interpretation, source); | ||
68840 | find mayExist(problem, interpretation, target); | ||
68841 | // Type consistency | ||
68842 | find mayInstanceOfFunctionalData_class(problem,interpretation,source); | ||
68843 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,target); | ||
68844 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
68845 | // the upper bound of the multiplicity should be considered. | ||
68846 | numberOfExistingReferences == count find mustInRelationinterface_reference_FunctionalData(problem,interpretation,source,_); | ||
68847 | check(numberOfExistingReferences < 1); | ||
68848 | // The eOpposite of the reference is containment, then a referene cannot be created if | ||
68849 | // 1. Multiple parents | ||
68850 | neg find mustContains4(problem,interpretation,source,_); | ||
68851 | // 2. Circle in the containment hierarchy | ||
68852 | neg find mustTransitiveContains(source,target); | ||
68853 | } or { | ||
68854 | find mustInRelationinterface_reference_FunctionalData(problem,interpretation,source,target); | ||
68855 | } | ||
68856 | /** | ||
68857 | * Matcher for detecting tuples t where []type attribute Function(source,target) | ||
68858 | */ | ||
68859 | private pattern mustInRelationtype_attribute_Function( | ||
68860 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
68861 | source: DefinedElement, target:DefinedElement) | ||
68862 | { | ||
68863 | find interpretation(problem,interpretation); | ||
68864 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
68865 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"type attribute Function"); | ||
68866 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
68867 | BinaryElementRelationLink.param1(link,source); | ||
68868 | BinaryElementRelationLink.param2(link,target); | ||
68869 | } | ||
68870 | /** | ||
68871 | * Matcher for detecting tuples t where <>type attribute Function(source,target) | ||
68872 | */ | ||
68873 | private pattern mayInRelationtype_attribute_Function( | ||
68874 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
68875 | source: DefinedElement, target:DefinedElement) | ||
68876 | { | ||
68877 | find interpretation(problem,interpretation); | ||
68878 | // The two endpoint of the link have to exist | ||
68879 | find mayExist(problem, interpretation, source); | ||
68880 | find mayExist(problem, interpretation, target); | ||
68881 | // Type consistency | ||
68882 | find mayInstanceOfFunction_class(problem,interpretation,source); | ||
68883 | find mayInstanceOfFunctionType_enum(problem,interpretation,target); | ||
68884 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
68885 | // the upper bound of the multiplicity should be considered. | ||
68886 | numberOfExistingReferences == count find mustInRelationtype_attribute_Function(problem,interpretation,source,_); | ||
68887 | check(numberOfExistingReferences < 1); | ||
68888 | } or { | ||
68889 | find mustInRelationtype_attribute_Function(problem,interpretation,source,target); | ||
68890 | } | ||
68891 | |||
68892 | ////////// | ||
68893 | // 1.3 Relation Definition Indexers | ||
68894 | ////////// | ||
68895 | // Must, May and Current queries for pattern ca mcgill ecse dslreasoner standalone test fam queries terminatorAndInformation | ||
68896 | private pattern mustInRelation_pattern_ca_mcgill_ecse_dslreasoner_standalone_test_fam_queries_terminatorAndInformation( | ||
68897 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
68898 | var_T, var_I) | ||
68899 | { | ||
68900 | find interpretation(problem,interpretation); | ||
68901 | find mustInstanceOfFAMTerminator_class(problem,interpretation,var_T); | ||
68902 | find mustInstanceOfInformationLink_class(problem,interpretation,var_I); | ||
68903 | // T is exported | ||
68904 | // I is exported | ||
68905 | find mustInstanceOfFunctionalOutput_class(problem,interpretation,var_Out); | ||
68906 | find mustInRelationoutgoingLinks_reference_FunctionalOutput(problem,interpretation,var_Out,var_virtual0); | ||
68907 | find mustInstanceOfInformationLink_class(problem,interpretation,var_virtual0); | ||
68908 | var_virtual0 == var_I; | ||
68909 | find mustInstanceOfFunctionalOutput_class(problem,interpretation,var_Out); | ||
68910 | find mustInRelationterminator_reference_FunctionalData(problem,interpretation,var_Out,var_virtual1); | ||
68911 | find mustInstanceOfFAMTerminator_class(problem,interpretation,var_virtual1); | ||
68912 | var_virtual1 == var_T; | ||
68913 | }or{ | ||
68914 | find interpretation(problem,interpretation); | ||
68915 | find mustInstanceOfFAMTerminator_class(problem,interpretation,var_T); | ||
68916 | find mustInstanceOfInformationLink_class(problem,interpretation,var_I); | ||
68917 | // T is exported | ||
68918 | // I is exported | ||
68919 | find mustInstanceOfInformationLink_class(problem,interpretation,var_I); | ||
68920 | find mustInRelationto_reference_InformationLink(problem,interpretation,var_I,var_virtual0); | ||
68921 | find mustInstanceOfFunctionalInput_class(problem,interpretation,var_virtual0); | ||
68922 | var_virtual0 == var_In; | ||
68923 | find mustInstanceOfFunctionalInput_class(problem,interpretation,var_In); | ||
68924 | find mustInRelationterminator_reference_FunctionalData(problem,interpretation,var_In,var_virtual1); | ||
68925 | find mustInstanceOfFAMTerminator_class(problem,interpretation,var_virtual1); | ||
68926 | var_virtual1 == var_T; | ||
68927 | } | ||
68928 | private pattern mayInRelation_pattern_ca_mcgill_ecse_dslreasoner_standalone_test_fam_queries_terminatorAndInformation( | ||
68929 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
68930 | var_T, var_I) | ||
68931 | { | ||
68932 | find interpretation(problem,interpretation); | ||
68933 | find mayInstanceOfFAMTerminator_class(problem,interpretation,var_T); | ||
68934 | find mayInstanceOfInformationLink_class(problem,interpretation,var_I); | ||
68935 | // T is exported | ||
68936 | // I is exported | ||
68937 | find mayInstanceOfFunctionalOutput_class(problem,interpretation,var_Out); | ||
68938 | find mayInRelationoutgoingLinks_reference_FunctionalOutput(problem,interpretation,var_Out,var_virtual0); | ||
68939 | find mayInstanceOfInformationLink_class(problem,interpretation,var_virtual0); | ||
68940 | find mayEquivalent(problem, interpretation, var_virtual0, var_I); | ||
68941 | find mayInstanceOfFunctionalOutput_class(problem,interpretation,var_Out); | ||
68942 | find mayInRelationterminator_reference_FunctionalData(problem,interpretation,var_Out,var_virtual1); | ||
68943 | find mayInstanceOfFAMTerminator_class(problem,interpretation,var_virtual1); | ||
68944 | find mayEquivalent(problem, interpretation, var_virtual1, var_T); | ||
68945 | }or{ | ||
68946 | find interpretation(problem,interpretation); | ||
68947 | find mayInstanceOfFAMTerminator_class(problem,interpretation,var_T); | ||
68948 | find mayInstanceOfInformationLink_class(problem,interpretation,var_I); | ||
68949 | // T is exported | ||
68950 | // I is exported | ||
68951 | find mayInstanceOfInformationLink_class(problem,interpretation,var_I); | ||
68952 | find mayInRelationto_reference_InformationLink(problem,interpretation,var_I,var_virtual0); | ||
68953 | find mayInstanceOfFunctionalInput_class(problem,interpretation,var_virtual0); | ||
68954 | find mayEquivalent(problem, interpretation, var_virtual0, var_In); | ||
68955 | find mayInstanceOfFunctionalInput_class(problem,interpretation,var_In); | ||
68956 | find mayInRelationterminator_reference_FunctionalData(problem,interpretation,var_In,var_virtual1); | ||
68957 | find mayInstanceOfFAMTerminator_class(problem,interpretation,var_virtual1); | ||
68958 | find mayEquivalent(problem, interpretation, var_virtual1, var_T); | ||
68959 | } | ||
68960 | private pattern currentInRelation_pattern_ca_mcgill_ecse_dslreasoner_standalone_test_fam_queries_terminatorAndInformation( | ||
68961 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
68962 | var_T, var_I) | ||
68963 | { | ||
68964 | find interpretation(problem,interpretation); | ||
68965 | find mustInstanceOfFAMTerminator_class(problem,interpretation,var_T); | ||
68966 | find mustInstanceOfInformationLink_class(problem,interpretation,var_I); | ||
68967 | // T is exported | ||
68968 | // I is exported | ||
68969 | find mustInstanceOfFunctionalOutput_class(problem,interpretation,var_Out); | ||
68970 | find mustInRelationoutgoingLinks_reference_FunctionalOutput(problem,interpretation,var_Out,var_virtual0); | ||
68971 | find mustInstanceOfInformationLink_class(problem,interpretation,var_virtual0); | ||
68972 | var_virtual0 == var_I; | ||
68973 | find mustInstanceOfFunctionalOutput_class(problem,interpretation,var_Out); | ||
68974 | find mustInRelationterminator_reference_FunctionalData(problem,interpretation,var_Out,var_virtual1); | ||
68975 | find mustInstanceOfFAMTerminator_class(problem,interpretation,var_virtual1); | ||
68976 | var_virtual1 == var_T; | ||
68977 | }or{ | ||
68978 | find interpretation(problem,interpretation); | ||
68979 | find mustInstanceOfFAMTerminator_class(problem,interpretation,var_T); | ||
68980 | find mustInstanceOfInformationLink_class(problem,interpretation,var_I); | ||
68981 | // T is exported | ||
68982 | // I is exported | ||
68983 | find mustInstanceOfInformationLink_class(problem,interpretation,var_I); | ||
68984 | find mustInRelationto_reference_InformationLink(problem,interpretation,var_I,var_virtual0); | ||
68985 | find mustInstanceOfFunctionalInput_class(problem,interpretation,var_virtual0); | ||
68986 | var_virtual0 == var_In; | ||
68987 | find mustInstanceOfFunctionalInput_class(problem,interpretation,var_In); | ||
68988 | find mustInRelationterminator_reference_FunctionalData(problem,interpretation,var_In,var_virtual1); | ||
68989 | find mustInstanceOfFAMTerminator_class(problem,interpretation,var_virtual1); | ||
68990 | var_virtual1 == var_T; | ||
68991 | } | ||
68992 | // Must, May and Current queries for pattern ca mcgill ecse dslreasoner standalone test fam queries rootElements | ||
68993 | private pattern mustInRelation_pattern_ca_mcgill_ecse_dslreasoner_standalone_test_fam_queries_rootElements( | ||
68994 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
68995 | var_Model, var_Root) | ||
68996 | { | ||
68997 | find interpretation(problem,interpretation); | ||
68998 | find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,var_Model); | ||
68999 | find mustInstanceOfFunction_class(problem,interpretation,var_Root); | ||
69000 | // Model is exported | ||
69001 | // Root is exported | ||
69002 | find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,var_Model); | ||
69003 | find mustInRelationrootElements_reference_FunctionalArchitectureModel(problem,interpretation,var_Model,var_virtual0); | ||
69004 | find mustInstanceOfFunctionalElement_class(problem,interpretation,var_virtual0); | ||
69005 | var_virtual0 == var_Root; | ||
69006 | } | ||
69007 | private pattern mayInRelation_pattern_ca_mcgill_ecse_dslreasoner_standalone_test_fam_queries_rootElements( | ||
69008 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
69009 | var_Model, var_Root) | ||
69010 | { | ||
69011 | find interpretation(problem,interpretation); | ||
69012 | find mayInstanceOfFunctionalArchitectureModel_class(problem,interpretation,var_Model); | ||
69013 | find mayInstanceOfFunction_class(problem,interpretation,var_Root); | ||
69014 | // Model is exported | ||
69015 | // Root is exported | ||
69016 | find mayInstanceOfFunctionalArchitectureModel_class(problem,interpretation,var_Model); | ||
69017 | find mayInRelationrootElements_reference_FunctionalArchitectureModel(problem,interpretation,var_Model,var_virtual0); | ||
69018 | find mayInstanceOfFunctionalElement_class(problem,interpretation,var_virtual0); | ||
69019 | find mayEquivalent(problem, interpretation, var_virtual0, var_Root); | ||
69020 | } | ||
69021 | private pattern currentInRelation_pattern_ca_mcgill_ecse_dslreasoner_standalone_test_fam_queries_rootElements( | ||
69022 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
69023 | var_Model, var_Root) | ||
69024 | { | ||
69025 | find interpretation(problem,interpretation); | ||
69026 | find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,var_Model); | ||
69027 | find mustInstanceOfFunction_class(problem,interpretation,var_Root); | ||
69028 | // Model is exported | ||
69029 | // Root is exported | ||
69030 | find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,var_Model); | ||
69031 | find mustInRelationrootElements_reference_FunctionalArchitectureModel(problem,interpretation,var_Model,var_virtual0); | ||
69032 | find mustInstanceOfFunctionalElement_class(problem,interpretation,var_virtual0); | ||
69033 | var_virtual0 == var_Root; | ||
69034 | } | ||
69035 | // Must, May and Current queries for pattern ca mcgill ecse dslreasoner standalone test fam queries parent | ||
69036 | private pattern mustInRelation_pattern_ca_mcgill_ecse_dslreasoner_standalone_test_fam_queries_parent( | ||
69037 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
69038 | var_Func, var_Par) | ||
69039 | { | ||
69040 | find interpretation(problem,interpretation); | ||
69041 | find mustInstanceOfFunction_class(problem,interpretation,var_Func); | ||
69042 | find mustInstanceOfFunction_class(problem,interpretation,var_Par); | ||
69043 | // Func is exported | ||
69044 | // Par is exported | ||
69045 | find mustInstanceOfFunction_class(problem,interpretation,var_Func); | ||
69046 | find mustInRelationparent_reference_FunctionalElement(problem,interpretation,var_Func,var_virtual0); | ||
69047 | find mustInstanceOfFunction_class(problem,interpretation,var_virtual0); | ||
69048 | var_virtual0 == var_Par; | ||
69049 | } | ||
69050 | private pattern mayInRelation_pattern_ca_mcgill_ecse_dslreasoner_standalone_test_fam_queries_parent( | ||
69051 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
69052 | var_Func, var_Par) | ||
69053 | { | ||
69054 | find interpretation(problem,interpretation); | ||
69055 | find mayInstanceOfFunction_class(problem,interpretation,var_Func); | ||
69056 | find mayInstanceOfFunction_class(problem,interpretation,var_Par); | ||
69057 | // Func is exported | ||
69058 | // Par is exported | ||
69059 | find mayInstanceOfFunction_class(problem,interpretation,var_Func); | ||
69060 | find mayInRelationparent_reference_FunctionalElement(problem,interpretation,var_Func,var_virtual0); | ||
69061 | find mayInstanceOfFunction_class(problem,interpretation,var_virtual0); | ||
69062 | find mayEquivalent(problem, interpretation, var_virtual0, var_Par); | ||
69063 | } | ||
69064 | private pattern currentInRelation_pattern_ca_mcgill_ecse_dslreasoner_standalone_test_fam_queries_parent( | ||
69065 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
69066 | var_Func, var_Par) | ||
69067 | { | ||
69068 | find interpretation(problem,interpretation); | ||
69069 | find mustInstanceOfFunction_class(problem,interpretation,var_Func); | ||
69070 | find mustInstanceOfFunction_class(problem,interpretation,var_Par); | ||
69071 | // Func is exported | ||
69072 | // Par is exported | ||
69073 | find mustInstanceOfFunction_class(problem,interpretation,var_Func); | ||
69074 | find mustInRelationparent_reference_FunctionalElement(problem,interpretation,var_Func,var_virtual0); | ||
69075 | find mustInstanceOfFunction_class(problem,interpretation,var_virtual0); | ||
69076 | var_virtual0 == var_Par; | ||
69077 | } | ||
69078 | |||
69079 | ////////// | ||
69080 | // 1.4 Containment Indexer | ||
69081 | ////////// | ||
69082 | private pattern mustContains2(source: DefinedElement, target: DefinedElement) { | ||
69083 | find mustContains4(_,_,source,target); | ||
69084 | } | ||
69085 | |||
69086 | private pattern mustContains4(problem:LogicProblem, interpretation:PartialInterpretation, | ||
69087 | source: DefinedElement, target: DefinedElement) | ||
69088 | { find mustInRelationinterface_reference_FunctionalElement(problem,interpretation,source,target); }or | ||
69089 | |||
69090 | { find mustInRelationrootElements_reference_FunctionalArchitectureModel(problem,interpretation,source,target); }or | ||
69091 | |||
69092 | { find mustInRelationsubElements_reference_Function(problem,interpretation,source,target); }or | ||
69093 | |||
69094 | { find mustInRelationdata_reference_FunctionalInterface(problem,interpretation,source,target); }or | ||
69095 | |||
69096 | { find mustInRelationoutgoingLinks_reference_FunctionalOutput(problem,interpretation,source,target); }or | ||
69097 | |||
69098 | { find mustInRelationterminator_reference_FunctionalData(problem,interpretation,source,target); } | ||
69099 | |||
69100 | private pattern mustTransitiveContains(source,target) { | ||
69101 | find mustContains2+(source,target); | ||
69102 | } | ||
69103 | |||
69104 | ////////// | ||
69105 | // 2. Invalidation Indexers | ||
69106 | ////////// | ||
69107 | // 2.1 Invalidated by WF Queries | ||
69108 | ////////// | ||
69109 | pattern invalidatedBy_pattern_ca_mcgill_ecse_dslreasoner_standalone_test_fam_queries_terminatorAndInformation(problem:LogicProblem, interpretation:PartialInterpretation, | ||
69110 | var_T, var_I) | ||
69111 | { | ||
69112 | find mustInRelation_pattern_ca_mcgill_ecse_dslreasoner_standalone_test_fam_queries_terminatorAndInformation(problem,interpretation,var_T,var_I); | ||
69113 | } | ||
69114 | |||
69115 | ////////// | ||
69116 | // 3. Unfinishedness Indexers | ||
69117 | ////////// | ||
69118 | // 3.1 Unfinishedness Measured by Multiplicity | ||
69119 | ////////// | ||
69120 | pattern unfinishedLowerMultiplicity_model_reference_FunctionalElement(problem:LogicProblem, interpretation:PartialInterpretation, relationIterpretation:PartialRelationInterpretation, object:DefinedElement,missingMultiplicity) { | ||
69121 | find interpretation(problem,interpretation); | ||
69122 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
69123 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"model reference FunctionalElement"); | ||
69124 | find mustInstanceOfFunctionalElement_class(problem,interpretation,object); | ||
69125 | numberOfExistingReferences == count find mustInRelationmodel_reference_FunctionalElement(problem,interpretation,object,_); | ||
69126 | check(numberOfExistingReferences < 1); | ||
69127 | missingMultiplicity == eval(1-numberOfExistingReferences); | ||
69128 | } | ||
69129 | pattern unfinishedLowerMultiplicity_to_reference_InformationLink(problem:LogicProblem, interpretation:PartialInterpretation, relationIterpretation:PartialRelationInterpretation, object:DefinedElement,missingMultiplicity) { | ||
69130 | find interpretation(problem,interpretation); | ||
69131 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
69132 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"to reference InformationLink"); | ||
69133 | find mustInstanceOfInformationLink_class(problem,interpretation,object); | ||
69134 | numberOfExistingReferences == count find mustInRelationto_reference_InformationLink(problem,interpretation,object,_); | ||
69135 | check(numberOfExistingReferences < 1); | ||
69136 | missingMultiplicity == eval(1-numberOfExistingReferences); | ||
69137 | } | ||
69138 | pattern unfinishedLowerMultiplicity_type_attribute_Function(problem:LogicProblem, interpretation:PartialInterpretation, relationIterpretation:PartialRelationInterpretation, object:DefinedElement,missingMultiplicity) { | ||
69139 | find interpretation(problem,interpretation); | ||
69140 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
69141 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"type attribute Function"); | ||
69142 | find mustInstanceOfFunction_class(problem,interpretation,object); | ||
69143 | numberOfExistingReferences == count find mustInRelationtype_attribute_Function(problem,interpretation,object,_); | ||
69144 | check(numberOfExistingReferences < 1); | ||
69145 | missingMultiplicity == eval(1-numberOfExistingReferences); | ||
69146 | } | ||
69147 | |||
69148 | ////////// | ||
69149 | // 3.2 Unfinishedness Measured by WF Queries | ||
69150 | ////////// | ||
69151 | pattern unfinishedBy_pattern_ca_mcgill_ecse_dslreasoner_standalone_test_fam_queries_terminatorAndInformation(problem:LogicProblem, interpretation:PartialInterpretation, | ||
69152 | var_T, var_I) | ||
69153 | { | ||
69154 | find currentInRelation_pattern_ca_mcgill_ecse_dslreasoner_standalone_test_fam_queries_terminatorAndInformation(problem,interpretation,var_T,var_I); | ||
69155 | } | ||
69156 | |||
69157 | ////////// | ||
69158 | // 4. Refinement Indexers | ||
69159 | ////////// | ||
69160 | // 4.1 Object constructors | ||
69161 | ////////// | ||
69162 | private pattern hasElementInContainment(problem:LogicProblem, interpretation:PartialInterpretation) | ||
69163 | { | ||
69164 | find interpretation(problem,interpretation); | ||
69165 | find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,root); | ||
69166 | find mustExist(problem, interpretation, root); | ||
69167 | }or{ | ||
69168 | find interpretation(problem,interpretation); | ||
69169 | find mustInstanceOfFunctionalInput_class(problem,interpretation,root); | ||
69170 | find mustExist(problem, interpretation, root); | ||
69171 | }or{ | ||
69172 | find interpretation(problem,interpretation); | ||
69173 | find mustInstanceOfFunctionalOutput_class(problem,interpretation,root); | ||
69174 | find mustExist(problem, interpretation, root); | ||
69175 | }or{ | ||
69176 | find interpretation(problem,interpretation); | ||
69177 | find mustInstanceOfFAMTerminator_class(problem,interpretation,root); | ||
69178 | find mustExist(problem, interpretation, root); | ||
69179 | }or{ | ||
69180 | find interpretation(problem,interpretation); | ||
69181 | find mustInstanceOfFunctionalInterface_class(problem,interpretation,root); | ||
69182 | find mustExist(problem, interpretation, root); | ||
69183 | }or{ | ||
69184 | find interpretation(problem,interpretation); | ||
69185 | find mustInstanceOfFunction_class(problem,interpretation,root); | ||
69186 | find mustExist(problem, interpretation, root); | ||
69187 | }or{ | ||
69188 | find interpretation(problem,interpretation); | ||
69189 | find mustInstanceOfInformationLink_class(problem,interpretation,root); | ||
69190 | find mustExist(problem, interpretation, root); | ||
69191 | }or{ | ||
69192 | find interpretation(problem,interpretation); | ||
69193 | find mustInstanceOfFunctionalElement_class(problem,interpretation,root); | ||
69194 | find mustExist(problem, interpretation, root); | ||
69195 | }or{ | ||
69196 | find interpretation(problem,interpretation); | ||
69197 | find mustInstanceOfFunctionalData_class(problem,interpretation,root); | ||
69198 | find mustExist(problem, interpretation, root); | ||
69199 | }or{ | ||
69200 | find interpretation(problem,interpretation); | ||
69201 | find mustInstanceOfFunctionalArchitectureModel_class_DefinedPart(problem,interpretation,root); | ||
69202 | find mustExist(problem, interpretation, root); | ||
69203 | }or{ | ||
69204 | find interpretation(problem,interpretation); | ||
69205 | find mustInstanceOfFunctionalArchitectureModel_class_UndefinedPart(problem,interpretation,root); | ||
69206 | find mustExist(problem, interpretation, root); | ||
69207 | } | ||
69208 | pattern createObject_FunctionalInterface_class_by_interface_reference_FunctionalElement_with_element_reference_FunctionalInterface( | ||
69209 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
69210 | relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
69211 | container:DefinedElement) | ||
69212 | { | ||
69213 | find interpretation(problem,interpretation); | ||
69214 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
69215 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalInterface class"); | ||
69216 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
69217 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"interface reference FunctionalElement"); | ||
69218 | PartialInterpretation.partialrelationinterpretation(interpretation,inverseInterpretation); | ||
69219 | PartialRelationInterpretation.interpretationOf.name(inverseInterpretation,"element reference FunctionalInterface"); | ||
69220 | find mustInstanceOfFunctionalElement_class(problem,interpretation,container); | ||
69221 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,newObject); | ||
69222 | find mayInRelationinterface_reference_FunctionalElement(problem,interpretation,container,newObject); | ||
69223 | find mustExist(problem, interpretation, container); | ||
69224 | neg find mustExist(problem, interpretation, newObject); | ||
69225 | } | ||
69226 | pattern createObject_FunctionalInterface_class( | ||
69227 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
69228 | typeInterpretation:PartialComplexTypeInterpretation) | ||
69229 | { | ||
69230 | find interpretation(problem,interpretation); | ||
69231 | neg find hasElementInContainment(problem,interpretation); | ||
69232 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
69233 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalInterface class"); | ||
69234 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,newObject); | ||
69235 | find mayExist(problem, interpretation, newObject); | ||
69236 | neg find mustExist(problem, interpretation, newObject); | ||
69237 | } | ||
69238 | pattern createObject_Function_class_by_rootElements_reference_FunctionalArchitectureModel( | ||
69239 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
69240 | relationInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
69241 | container:DefinedElement) | ||
69242 | { | ||
69243 | find interpretation(problem,interpretation); | ||
69244 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
69245 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"Function class"); | ||
69246 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
69247 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"rootElements reference FunctionalArchitectureModel"); | ||
69248 | find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,container); | ||
69249 | find mayInstanceOfFunction_class(problem,interpretation,newObject); | ||
69250 | find mayInRelationrootElements_reference_FunctionalArchitectureModel(problem,interpretation,container,newObject); | ||
69251 | find mustExist(problem, interpretation, container); | ||
69252 | neg find mustExist(problem, interpretation, newObject); | ||
69253 | } | ||
69254 | pattern createObject_Function_class_by_subElements_reference_Function_with_parent_reference_FunctionalElement( | ||
69255 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
69256 | relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
69257 | container:DefinedElement) | ||
69258 | { | ||
69259 | find interpretation(problem,interpretation); | ||
69260 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
69261 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"Function class"); | ||
69262 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
69263 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"subElements reference Function"); | ||
69264 | PartialInterpretation.partialrelationinterpretation(interpretation,inverseInterpretation); | ||
69265 | PartialRelationInterpretation.interpretationOf.name(inverseInterpretation,"parent reference FunctionalElement"); | ||
69266 | find mustInstanceOfFunction_class(problem,interpretation,container); | ||
69267 | find mayInstanceOfFunction_class(problem,interpretation,newObject); | ||
69268 | find mayInRelationsubElements_reference_Function(problem,interpretation,container,newObject); | ||
69269 | find mustExist(problem, interpretation, container); | ||
69270 | neg find mustExist(problem, interpretation, newObject); | ||
69271 | } | ||
69272 | pattern createObject_Function_class( | ||
69273 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
69274 | typeInterpretation:PartialComplexTypeInterpretation) | ||
69275 | { | ||
69276 | find interpretation(problem,interpretation); | ||
69277 | neg find hasElementInContainment(problem,interpretation); | ||
69278 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
69279 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"Function class"); | ||
69280 | find mayInstanceOfFunction_class(problem,interpretation,newObject); | ||
69281 | find mayExist(problem, interpretation, newObject); | ||
69282 | neg find mustExist(problem, interpretation, newObject); | ||
69283 | } | ||
69284 | pattern createObject_FunctionalOutput_class_by_data_reference_FunctionalInterface_with_interface_reference_FunctionalData( | ||
69285 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
69286 | relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
69287 | container:DefinedElement) | ||
69288 | { | ||
69289 | find interpretation(problem,interpretation); | ||
69290 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
69291 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalOutput class"); | ||
69292 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
69293 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"data reference FunctionalInterface"); | ||
69294 | PartialInterpretation.partialrelationinterpretation(interpretation,inverseInterpretation); | ||
69295 | PartialRelationInterpretation.interpretationOf.name(inverseInterpretation,"interface reference FunctionalData"); | ||
69296 | find mustInstanceOfFunctionalInterface_class(problem,interpretation,container); | ||
69297 | find mayInstanceOfFunctionalOutput_class(problem,interpretation,newObject); | ||
69298 | find mayInRelationdata_reference_FunctionalInterface(problem,interpretation,container,newObject); | ||
69299 | find mustExist(problem, interpretation, container); | ||
69300 | neg find mustExist(problem, interpretation, newObject); | ||
69301 | } | ||
69302 | pattern createObject_FunctionalOutput_class( | ||
69303 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
69304 | typeInterpretation:PartialComplexTypeInterpretation) | ||
69305 | { | ||
69306 | find interpretation(problem,interpretation); | ||
69307 | neg find hasElementInContainment(problem,interpretation); | ||
69308 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
69309 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalOutput class"); | ||
69310 | find mayInstanceOfFunctionalOutput_class(problem,interpretation,newObject); | ||
69311 | find mayExist(problem, interpretation, newObject); | ||
69312 | neg find mustExist(problem, interpretation, newObject); | ||
69313 | } | ||
69314 | pattern createObject_FunctionalArchitectureModel_class_UndefinedPart( | ||
69315 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
69316 | typeInterpretation:PartialComplexTypeInterpretation) | ||
69317 | { | ||
69318 | find interpretation(problem,interpretation); | ||
69319 | neg find hasElementInContainment(problem,interpretation); | ||
69320 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
69321 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalArchitectureModel class UndefinedPart"); | ||
69322 | find mayInstanceOfFunctionalArchitectureModel_class_UndefinedPart(problem,interpretation,newObject); | ||
69323 | find mayExist(problem, interpretation, newObject); | ||
69324 | neg find mustExist(problem, interpretation, newObject); | ||
69325 | } | ||
69326 | pattern createObject_FAMTerminator_class_by_terminator_reference_FunctionalData_with_data_reference_FAMTerminator( | ||
69327 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
69328 | relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
69329 | container:DefinedElement) | ||
69330 | { | ||
69331 | find interpretation(problem,interpretation); | ||
69332 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
69333 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FAMTerminator class"); | ||
69334 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
69335 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"terminator reference FunctionalData"); | ||
69336 | PartialInterpretation.partialrelationinterpretation(interpretation,inverseInterpretation); | ||
69337 | PartialRelationInterpretation.interpretationOf.name(inverseInterpretation,"data reference FAMTerminator"); | ||
69338 | find mustInstanceOfFunctionalData_class(problem,interpretation,container); | ||
69339 | find mayInstanceOfFAMTerminator_class(problem,interpretation,newObject); | ||
69340 | find mayInRelationterminator_reference_FunctionalData(problem,interpretation,container,newObject); | ||
69341 | find mustExist(problem, interpretation, container); | ||
69342 | neg find mustExist(problem, interpretation, newObject); | ||
69343 | } | ||
69344 | pattern createObject_FAMTerminator_class( | ||
69345 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
69346 | typeInterpretation:PartialComplexTypeInterpretation) | ||
69347 | { | ||
69348 | find interpretation(problem,interpretation); | ||
69349 | neg find hasElementInContainment(problem,interpretation); | ||
69350 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
69351 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FAMTerminator class"); | ||
69352 | find mayInstanceOfFAMTerminator_class(problem,interpretation,newObject); | ||
69353 | find mayExist(problem, interpretation, newObject); | ||
69354 | neg find mustExist(problem, interpretation, newObject); | ||
69355 | } | ||
69356 | pattern createObject_InformationLink_class_by_outgoingLinks_reference_FunctionalOutput_with_from_reference_InformationLink( | ||
69357 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
69358 | relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
69359 | container:DefinedElement) | ||
69360 | { | ||
69361 | find interpretation(problem,interpretation); | ||
69362 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
69363 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"InformationLink class"); | ||
69364 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
69365 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"outgoingLinks reference FunctionalOutput"); | ||
69366 | PartialInterpretation.partialrelationinterpretation(interpretation,inverseInterpretation); | ||
69367 | PartialRelationInterpretation.interpretationOf.name(inverseInterpretation,"from reference InformationLink"); | ||
69368 | find mustInstanceOfFunctionalOutput_class(problem,interpretation,container); | ||
69369 | find mayInstanceOfInformationLink_class(problem,interpretation,newObject); | ||
69370 | find mayInRelationoutgoingLinks_reference_FunctionalOutput(problem,interpretation,container,newObject); | ||
69371 | find mustExist(problem, interpretation, container); | ||
69372 | neg find mustExist(problem, interpretation, newObject); | ||
69373 | } | ||
69374 | pattern createObject_InformationLink_class( | ||
69375 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
69376 | typeInterpretation:PartialComplexTypeInterpretation) | ||
69377 | { | ||
69378 | find interpretation(problem,interpretation); | ||
69379 | neg find hasElementInContainment(problem,interpretation); | ||
69380 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
69381 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"InformationLink class"); | ||
69382 | find mayInstanceOfInformationLink_class(problem,interpretation,newObject); | ||
69383 | find mayExist(problem, interpretation, newObject); | ||
69384 | neg find mustExist(problem, interpretation, newObject); | ||
69385 | } | ||
69386 | pattern createObject_FunctionalInput_class_by_data_reference_FunctionalInterface_with_interface_reference_FunctionalData( | ||
69387 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
69388 | relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
69389 | container:DefinedElement) | ||
69390 | { | ||
69391 | find interpretation(problem,interpretation); | ||
69392 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
69393 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalInput class"); | ||
69394 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
69395 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"data reference FunctionalInterface"); | ||
69396 | PartialInterpretation.partialrelationinterpretation(interpretation,inverseInterpretation); | ||
69397 | PartialRelationInterpretation.interpretationOf.name(inverseInterpretation,"interface reference FunctionalData"); | ||
69398 | find mustInstanceOfFunctionalInterface_class(problem,interpretation,container); | ||
69399 | find mayInstanceOfFunctionalInput_class(problem,interpretation,newObject); | ||
69400 | find mayInRelationdata_reference_FunctionalInterface(problem,interpretation,container,newObject); | ||
69401 | find mustExist(problem, interpretation, container); | ||
69402 | neg find mustExist(problem, interpretation, newObject); | ||
69403 | } | ||
69404 | pattern createObject_FunctionalInput_class( | ||
69405 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
69406 | typeInterpretation:PartialComplexTypeInterpretation) | ||
69407 | { | ||
69408 | find interpretation(problem,interpretation); | ||
69409 | neg find hasElementInContainment(problem,interpretation); | ||
69410 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
69411 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalInput class"); | ||
69412 | find mayInstanceOfFunctionalInput_class(problem,interpretation,newObject); | ||
69413 | find mayExist(problem, interpretation, newObject); | ||
69414 | neg find mustExist(problem, interpretation, newObject); | ||
69415 | } | ||
69416 | |||
69417 | ////////// | ||
69418 | // 4.2 Type refinement | ||
69419 | ////////// | ||
69420 | pattern refineTypeTo_FunctionalInterface_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
69421 | find interpretation(problem,interpretation); | ||
69422 | PartialInterpretation.newElements(interpretation,element); | ||
69423 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
69424 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
69425 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
69426 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
69427 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
69428 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
69429 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
69430 | } | ||
69431 | pattern refineTypeTo_Function_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
69432 | find interpretation(problem,interpretation); | ||
69433 | PartialInterpretation.newElements(interpretation,element); | ||
69434 | find mayInstanceOfFunction_class(problem,interpretation,element); | ||
69435 | neg find mustInstanceOfFunction_class(problem,interpretation,element); | ||
69436 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
69437 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
69438 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
69439 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
69440 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
69441 | } | ||
69442 | pattern refineTypeTo_FunctionalOutput_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
69443 | find interpretation(problem,interpretation); | ||
69444 | PartialInterpretation.newElements(interpretation,element); | ||
69445 | find mayInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
69446 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
69447 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
69448 | neg find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
69449 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
69450 | neg find mustInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
69451 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
69452 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
69453 | } | ||
69454 | pattern refineTypeTo_FunctionalArchitectureModel_class_UndefinedPart(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
69455 | find interpretation(problem,interpretation); | ||
69456 | PartialInterpretation.newElements(interpretation,element); | ||
69457 | find mayInstanceOfFunctionalArchitectureModel_class_UndefinedPart(problem,interpretation,element); | ||
69458 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
69459 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
69460 | neg find mustInstanceOfFunctionalArchitectureModel_class_UndefinedPart(problem,interpretation,element); | ||
69461 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
69462 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
69463 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
69464 | } | ||
69465 | pattern refineTypeTo_FAMTerminator_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
69466 | find interpretation(problem,interpretation); | ||
69467 | PartialInterpretation.newElements(interpretation,element); | ||
69468 | find mayInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
69469 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
69470 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
69471 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
69472 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
69473 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
69474 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
69475 | } | ||
69476 | pattern refineTypeTo_InformationLink_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
69477 | find interpretation(problem,interpretation); | ||
69478 | PartialInterpretation.newElements(interpretation,element); | ||
69479 | find mayInstanceOfInformationLink_class(problem,interpretation,element); | ||
69480 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
69481 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
69482 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
69483 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
69484 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
69485 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
69486 | } | ||
69487 | pattern refineTypeTo_FunctionalInput_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
69488 | find interpretation(problem,interpretation); | ||
69489 | PartialInterpretation.newElements(interpretation,element); | ||
69490 | find mayInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
69491 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
69492 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
69493 | neg find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
69494 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
69495 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
69496 | neg find mustInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
69497 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
69498 | } | ||
69499 | |||
69500 | ////////// | ||
69501 | // 4.3 Relation refinement | ||
69502 | ////////// | ||
69503 | pattern refineRelation_model_reference_FunctionalElement( | ||
69504 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
69505 | relationIterpretation:PartialRelationInterpretation, | ||
69506 | from: DefinedElement, to: DefinedElement) | ||
69507 | { | ||
69508 | find interpretation(problem,interpretation); | ||
69509 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
69510 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"model reference FunctionalElement"); | ||
69511 | find mustExist(problem, interpretation, from); | ||
69512 | find mustExist(problem, interpretation, to); | ||
69513 | find mustInstanceOfFunctionalElement_class(problem,interpretation,from); | ||
69514 | find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,to); | ||
69515 | find mayInRelationmodel_reference_FunctionalElement(problem,interpretation,from,to); | ||
69516 | neg find mustInRelationmodel_reference_FunctionalElement(problem,interpretation,from,to); | ||
69517 | } | ||
69518 | pattern refineRelation_IncomingLinks_reference_FunctionalInput_and_to_reference_InformationLink( | ||
69519 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
69520 | relationIterpretation:PartialRelationInterpretation, oppositeInterpretation:PartialRelationInterpretation, | ||
69521 | from: DefinedElement, to: DefinedElement) | ||
69522 | { | ||
69523 | find interpretation(problem,interpretation); | ||
69524 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
69525 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"IncomingLinks reference FunctionalInput"); | ||
69526 | PartialInterpretation.partialrelationinterpretation(interpretation,oppositeInterpretation); | ||
69527 | PartialRelationInterpretation.interpretationOf.name(oppositeInterpretation,"to reference InformationLink"); | ||
69528 | find mustExist(problem, interpretation, from); | ||
69529 | find mustExist(problem, interpretation, to); | ||
69530 | find mustInstanceOfFunctionalInput_class(problem,interpretation,from); | ||
69531 | find mustInstanceOfInformationLink_class(problem,interpretation,to); | ||
69532 | find mayInRelationIncomingLinks_reference_FunctionalInput(problem,interpretation,from,to); | ||
69533 | neg find mustInRelationIncomingLinks_reference_FunctionalInput(problem,interpretation,from,to); | ||
69534 | } | ||
69535 | pattern refineRelation_type_attribute_Function( | ||
69536 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
69537 | relationIterpretation:PartialRelationInterpretation, | ||
69538 | from: DefinedElement, to: DefinedElement) | ||
69539 | { | ||
69540 | find interpretation(problem,interpretation); | ||
69541 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
69542 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"type attribute Function"); | ||
69543 | find mustExist(problem, interpretation, from); | ||
69544 | find mustExist(problem, interpretation, to); | ||
69545 | find mustInstanceOfFunction_class(problem,interpretation,from); | ||
69546 | find mustInstanceOfFunctionType_enum(problem,interpretation,to); | ||
69547 | find mayInRelationtype_attribute_Function(problem,interpretation,from,to); | ||
69548 | neg find mustInRelationtype_attribute_Function(problem,interpretation,from,to); | ||
69549 | } | ||
69550 | import epackage "http://www.bme.hu/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage" | ||
69551 | import epackage "http://www.bme.hu/mit/inf/dslreasoner/logic/model/problem" | ||
69552 | import epackage "http://www.bme.hu/mit/inf/dslreasoner/logic/model/language" | ||
69553 | |||
69554 | ////////// | ||
69555 | // 0. Util | ||
69556 | ////////// | ||
69557 | private pattern interpretation(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
69558 | PartialInterpretation.problem(interpretation,problem); | ||
69559 | } | ||
69560 | |||
69561 | ///////////////////////// | ||
69562 | // 0.1 Existence | ||
69563 | ///////////////////////// | ||
69564 | private pattern mustExist(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
69565 | find interpretation(problem,interpretation); | ||
69566 | LogicProblem.elements(problem,element); | ||
69567 | } or { | ||
69568 | find interpretation(problem,interpretation); | ||
69569 | PartialInterpretation.newElements(interpretation,element); | ||
69570 | } | ||
69571 | |||
69572 | private pattern mayExist(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
69573 | find mustExist(problem,interpretation,element); | ||
69574 | } or { | ||
69575 | find interpretation(problem,interpretation); | ||
69576 | neg find elementCloseWorld(element); | ||
69577 | PartialInterpretation.openWorldElements(interpretation,element); | ||
69578 | } | ||
69579 | |||
69580 | private pattern elementCloseWorld(element:DefinedElement) { | ||
69581 | PartialInterpretation.openWorldElements(i,element); | ||
69582 | PartialInterpretation.maxNewElements(i,0); | ||
69583 | } or { | ||
69584 | Scope.targetTypeInterpretation(scope,interpretation); | ||
69585 | PartialTypeInterpratation.elements(interpretation,element); | ||
69586 | Scope.maxNewElements(scope,0); | ||
69587 | } | ||
69588 | |||
69589 | //////////////////////// | ||
69590 | // 0.2 Equivalence | ||
69591 | //////////////////////// | ||
69592 | pattern mayEquivalent(problem:LogicProblem, interpretation:PartialInterpretation, a: DefinedElement, b: DefinedElement) { | ||
69593 | find mayExist(problem,interpretation,a); | ||
69594 | find mayExist(problem,interpretation,b); | ||
69595 | a == b; | ||
69596 | } | ||
69597 | |||
69598 | //////////////////////// | ||
69599 | // 0.3 Required Patterns by TypeIndexer | ||
69600 | //////////////////////// | ||
69601 | private pattern typeInterpretation(problem:LogicProblem, interpretation:PartialInterpretation, type:TypeDeclaration, typeInterpretation:PartialComplexTypeInterpretation) { | ||
69602 | find interpretation(problem,interpretation); | ||
69603 | LogicProblem.types(problem,type); | ||
69604 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
69605 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
69606 | } | ||
69607 | |||
69608 | private pattern directInstanceOf(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement, type:Type) { | ||
69609 | find interpretation(problem,interpretation); | ||
69610 | LogicProblem.types(problem,type); | ||
69611 | TypeDefinition.elements(type,element); | ||
69612 | } or { | ||
69613 | find interpretation(problem,interpretation); | ||
69614 | find typeInterpretation(problem,interpretation,type,typeInterpretation); | ||
69615 | PartialComplexTypeInterpretation.elements(typeInterpretation,element); | ||
69616 | } | ||
69617 | |||
69618 | private pattern isPrimitive(element: PrimitiveElement) { | ||
69619 | PrimitiveElement(element); | ||
69620 | } | ||
69621 | |||
69622 | ////////// | ||
69623 | // 1. Problem-Specific Base Indexers | ||
69624 | ////////// | ||
69625 | // 1.1 Type Indexers | ||
69626 | ////////// | ||
69627 | // 1.1.1 primitive Type Indexers | ||
69628 | ////////// | ||
69629 | |||
69630 | ////////// | ||
69631 | // 1.1.2 domain-specific Type Indexers | ||
69632 | ////////// | ||
69633 | /** | ||
69634 | * An element must be an instance of type "FunctionalElement class". | ||
69635 | */ | ||
69636 | private pattern mustInstanceOfFunctionalElement_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
69637 | Type.name(type,"FunctionalElement class"); | ||
69638 | find directInstanceOf(problem,interpretation,element,type); | ||
69639 | } | ||
69640 | private pattern scopeDisallowsNewFunctionalElement_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
69641 | find interpretation(problem,interpretation); | ||
69642 | PartialInterpretation.scopes(interpretation,scope); | ||
69643 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
69644 | Scope.maxNewElements(scope,0); | ||
69645 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
69646 | Type.name(type,"FunctionalElement class"); | ||
69647 | } | ||
69648 | |||
69649 | /** | ||
69650 | * An element may be an instance of type "FunctionalElement class". | ||
69651 | */ | ||
69652 | private pattern mayInstanceOfFunctionalElement_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
69653 | { | ||
69654 | find interpretation(problem,interpretation); | ||
69655 | PartialInterpretation.newElements(interpretation,element); | ||
69656 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
69657 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
69658 | neg find mustInstanceOfFunction_class(problem,interpretation,element); | ||
69659 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
69660 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
69661 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
69662 | neg find scopeDisallowsNewFunctionalElement_class(problem, interpretation); | ||
69663 | neg find isPrimitive(element); | ||
69664 | } or { | ||
69665 | find interpretation(problem,interpretation); | ||
69666 | PartialInterpretation.openWorldElements(interpretation,element); | ||
69667 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
69668 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
69669 | neg find mustInstanceOfFunction_class(problem,interpretation,element); | ||
69670 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
69671 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
69672 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
69673 | neg find scopeDisallowsNewFunctionalElement_class(problem, interpretation); | ||
69674 | neg find isPrimitive(element); | ||
69675 | } or | ||
69676 | { find mustInstanceOfFunctionalElement_class(problem,interpretation,element); } | ||
69677 | /** | ||
69678 | * An element must be an instance of type "FunctionalArchitectureModel class". | ||
69679 | */ | ||
69680 | private pattern mustInstanceOfFunctionalArchitectureModel_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
69681 | Type.name(type,"FunctionalArchitectureModel class"); | ||
69682 | find directInstanceOf(problem,interpretation,element,type); | ||
69683 | } | ||
69684 | private pattern scopeDisallowsNewFunctionalArchitectureModel_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
69685 | find interpretation(problem,interpretation); | ||
69686 | PartialInterpretation.scopes(interpretation,scope); | ||
69687 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
69688 | Scope.maxNewElements(scope,0); | ||
69689 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
69690 | Type.name(type,"FunctionalArchitectureModel class"); | ||
69691 | } | ||
69692 | |||
69693 | /** | ||
69694 | * An element may be an instance of type "FunctionalArchitectureModel class". | ||
69695 | */ | ||
69696 | private pattern mayInstanceOfFunctionalArchitectureModel_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
69697 | { | ||
69698 | find interpretation(problem,interpretation); | ||
69699 | PartialInterpretation.newElements(interpretation,element); | ||
69700 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
69701 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
69702 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
69703 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
69704 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
69705 | neg find scopeDisallowsNewFunctionalArchitectureModel_class(problem, interpretation); | ||
69706 | neg find isPrimitive(element); | ||
69707 | } or { | ||
69708 | find interpretation(problem,interpretation); | ||
69709 | PartialInterpretation.openWorldElements(interpretation,element); | ||
69710 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
69711 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
69712 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
69713 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
69714 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
69715 | neg find scopeDisallowsNewFunctionalArchitectureModel_class(problem, interpretation); | ||
69716 | neg find isPrimitive(element); | ||
69717 | } or | ||
69718 | { find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); } | ||
69719 | /** | ||
69720 | * An element must be an instance of type "Function class". | ||
69721 | */ | ||
69722 | private pattern mustInstanceOfFunction_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
69723 | Type.name(type,"Function class"); | ||
69724 | find directInstanceOf(problem,interpretation,element,type); | ||
69725 | } | ||
69726 | private pattern scopeDisallowsNewFunction_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
69727 | find interpretation(problem,interpretation); | ||
69728 | PartialInterpretation.scopes(interpretation,scope); | ||
69729 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
69730 | Scope.maxNewElements(scope,0); | ||
69731 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
69732 | Type.name(type,"Function class"); | ||
69733 | } | ||
69734 | |||
69735 | /** | ||
69736 | * An element may be an instance of type "Function class". | ||
69737 | */ | ||
69738 | private pattern mayInstanceOfFunction_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
69739 | { | ||
69740 | find interpretation(problem,interpretation); | ||
69741 | PartialInterpretation.newElements(interpretation,element); | ||
69742 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
69743 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
69744 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
69745 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
69746 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
69747 | neg find scopeDisallowsNewFunction_class(problem, interpretation); | ||
69748 | neg find isPrimitive(element); | ||
69749 | } or { | ||
69750 | find interpretation(problem,interpretation); | ||
69751 | PartialInterpretation.openWorldElements(interpretation,element); | ||
69752 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
69753 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
69754 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
69755 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
69756 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
69757 | neg find scopeDisallowsNewFunction_class(problem, interpretation); | ||
69758 | neg find isPrimitive(element); | ||
69759 | } or | ||
69760 | { find mustInstanceOfFunction_class(problem,interpretation,element); } | ||
69761 | /** | ||
69762 | * An element must be an instance of type "FAMTerminator class". | ||
69763 | */ | ||
69764 | private pattern mustInstanceOfFAMTerminator_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
69765 | Type.name(type,"FAMTerminator class"); | ||
69766 | find directInstanceOf(problem,interpretation,element,type); | ||
69767 | } | ||
69768 | private pattern scopeDisallowsNewFAMTerminator_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
69769 | find interpretation(problem,interpretation); | ||
69770 | PartialInterpretation.scopes(interpretation,scope); | ||
69771 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
69772 | Scope.maxNewElements(scope,0); | ||
69773 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
69774 | Type.name(type,"FAMTerminator class"); | ||
69775 | } | ||
69776 | |||
69777 | /** | ||
69778 | * An element may be an instance of type "FAMTerminator class". | ||
69779 | */ | ||
69780 | private pattern mayInstanceOfFAMTerminator_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
69781 | { | ||
69782 | find interpretation(problem,interpretation); | ||
69783 | PartialInterpretation.newElements(interpretation,element); | ||
69784 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
69785 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
69786 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
69787 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
69788 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
69789 | neg find scopeDisallowsNewFAMTerminator_class(problem, interpretation); | ||
69790 | neg find isPrimitive(element); | ||
69791 | } or { | ||
69792 | find interpretation(problem,interpretation); | ||
69793 | PartialInterpretation.openWorldElements(interpretation,element); | ||
69794 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
69795 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
69796 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
69797 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
69798 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
69799 | neg find scopeDisallowsNewFAMTerminator_class(problem, interpretation); | ||
69800 | neg find isPrimitive(element); | ||
69801 | } or | ||
69802 | { find mustInstanceOfFAMTerminator_class(problem,interpretation,element); } | ||
69803 | /** | ||
69804 | * An element must be an instance of type "InformationLink class". | ||
69805 | */ | ||
69806 | private pattern mustInstanceOfInformationLink_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
69807 | Type.name(type,"InformationLink class"); | ||
69808 | find directInstanceOf(problem,interpretation,element,type); | ||
69809 | } | ||
69810 | private pattern scopeDisallowsNewInformationLink_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
69811 | find interpretation(problem,interpretation); | ||
69812 | PartialInterpretation.scopes(interpretation,scope); | ||
69813 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
69814 | Scope.maxNewElements(scope,0); | ||
69815 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
69816 | Type.name(type,"InformationLink class"); | ||
69817 | } | ||
69818 | |||
69819 | /** | ||
69820 | * An element may be an instance of type "InformationLink class". | ||
69821 | */ | ||
69822 | private pattern mayInstanceOfInformationLink_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
69823 | { | ||
69824 | find interpretation(problem,interpretation); | ||
69825 | PartialInterpretation.newElements(interpretation,element); | ||
69826 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
69827 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
69828 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
69829 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
69830 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
69831 | neg find scopeDisallowsNewInformationLink_class(problem, interpretation); | ||
69832 | neg find isPrimitive(element); | ||
69833 | } or { | ||
69834 | find interpretation(problem,interpretation); | ||
69835 | PartialInterpretation.openWorldElements(interpretation,element); | ||
69836 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
69837 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
69838 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
69839 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
69840 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
69841 | neg find scopeDisallowsNewInformationLink_class(problem, interpretation); | ||
69842 | neg find isPrimitive(element); | ||
69843 | } or | ||
69844 | { find mustInstanceOfInformationLink_class(problem,interpretation,element); } | ||
69845 | /** | ||
69846 | * An element must be an instance of type "FunctionalInterface class". | ||
69847 | */ | ||
69848 | private pattern mustInstanceOfFunctionalInterface_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
69849 | Type.name(type,"FunctionalInterface class"); | ||
69850 | find directInstanceOf(problem,interpretation,element,type); | ||
69851 | } | ||
69852 | private pattern scopeDisallowsNewFunctionalInterface_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
69853 | find interpretation(problem,interpretation); | ||
69854 | PartialInterpretation.scopes(interpretation,scope); | ||
69855 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
69856 | Scope.maxNewElements(scope,0); | ||
69857 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
69858 | Type.name(type,"FunctionalInterface class"); | ||
69859 | } | ||
69860 | |||
69861 | /** | ||
69862 | * An element may be an instance of type "FunctionalInterface class". | ||
69863 | */ | ||
69864 | private pattern mayInstanceOfFunctionalInterface_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
69865 | { | ||
69866 | find interpretation(problem,interpretation); | ||
69867 | PartialInterpretation.newElements(interpretation,element); | ||
69868 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
69869 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
69870 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
69871 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
69872 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
69873 | neg find scopeDisallowsNewFunctionalInterface_class(problem, interpretation); | ||
69874 | neg find isPrimitive(element); | ||
69875 | } or { | ||
69876 | find interpretation(problem,interpretation); | ||
69877 | PartialInterpretation.openWorldElements(interpretation,element); | ||
69878 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
69879 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
69880 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
69881 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
69882 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
69883 | neg find scopeDisallowsNewFunctionalInterface_class(problem, interpretation); | ||
69884 | neg find isPrimitive(element); | ||
69885 | } or | ||
69886 | { find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); } | ||
69887 | /** | ||
69888 | * An element must be an instance of type "FunctionalInput class". | ||
69889 | */ | ||
69890 | private pattern mustInstanceOfFunctionalInput_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
69891 | Type.name(type,"FunctionalInput class"); | ||
69892 | find directInstanceOf(problem,interpretation,element,type); | ||
69893 | } | ||
69894 | private pattern scopeDisallowsNewFunctionalInput_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
69895 | find interpretation(problem,interpretation); | ||
69896 | PartialInterpretation.scopes(interpretation,scope); | ||
69897 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
69898 | Scope.maxNewElements(scope,0); | ||
69899 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
69900 | Type.name(type,"FunctionalInput class"); | ||
69901 | } | ||
69902 | |||
69903 | /** | ||
69904 | * An element may be an instance of type "FunctionalInput class". | ||
69905 | */ | ||
69906 | private pattern mayInstanceOfFunctionalInput_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
69907 | { | ||
69908 | find interpretation(problem,interpretation); | ||
69909 | PartialInterpretation.newElements(interpretation,element); | ||
69910 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
69911 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
69912 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
69913 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
69914 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
69915 | neg find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
69916 | neg find scopeDisallowsNewFunctionalInput_class(problem, interpretation); | ||
69917 | neg find isPrimitive(element); | ||
69918 | } or { | ||
69919 | find interpretation(problem,interpretation); | ||
69920 | PartialInterpretation.openWorldElements(interpretation,element); | ||
69921 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
69922 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
69923 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
69924 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
69925 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
69926 | neg find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
69927 | neg find scopeDisallowsNewFunctionalInput_class(problem, interpretation); | ||
69928 | neg find isPrimitive(element); | ||
69929 | } or | ||
69930 | { find mustInstanceOfFunctionalInput_class(problem,interpretation,element); } | ||
69931 | /** | ||
69932 | * An element must be an instance of type "FunctionalOutput class". | ||
69933 | */ | ||
69934 | private pattern mustInstanceOfFunctionalOutput_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
69935 | Type.name(type,"FunctionalOutput class"); | ||
69936 | find directInstanceOf(problem,interpretation,element,type); | ||
69937 | } | ||
69938 | private pattern scopeDisallowsNewFunctionalOutput_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
69939 | find interpretation(problem,interpretation); | ||
69940 | PartialInterpretation.scopes(interpretation,scope); | ||
69941 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
69942 | Scope.maxNewElements(scope,0); | ||
69943 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
69944 | Type.name(type,"FunctionalOutput class"); | ||
69945 | } | ||
69946 | |||
69947 | /** | ||
69948 | * An element may be an instance of type "FunctionalOutput class". | ||
69949 | */ | ||
69950 | private pattern mayInstanceOfFunctionalOutput_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
69951 | { | ||
69952 | find interpretation(problem,interpretation); | ||
69953 | PartialInterpretation.newElements(interpretation,element); | ||
69954 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
69955 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
69956 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
69957 | neg find mustInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
69958 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
69959 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
69960 | neg find scopeDisallowsNewFunctionalOutput_class(problem, interpretation); | ||
69961 | neg find isPrimitive(element); | ||
69962 | } or { | ||
69963 | find interpretation(problem,interpretation); | ||
69964 | PartialInterpretation.openWorldElements(interpretation,element); | ||
69965 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
69966 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
69967 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
69968 | neg find mustInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
69969 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
69970 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
69971 | neg find scopeDisallowsNewFunctionalOutput_class(problem, interpretation); | ||
69972 | neg find isPrimitive(element); | ||
69973 | } or | ||
69974 | { find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); } | ||
69975 | /** | ||
69976 | * An element must be an instance of type "FunctionalData class". | ||
69977 | */ | ||
69978 | private pattern mustInstanceOfFunctionalData_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
69979 | Type.name(type,"FunctionalData class"); | ||
69980 | find directInstanceOf(problem,interpretation,element,type); | ||
69981 | } | ||
69982 | private pattern scopeDisallowsNewFunctionalData_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
69983 | find interpretation(problem,interpretation); | ||
69984 | PartialInterpretation.scopes(interpretation,scope); | ||
69985 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
69986 | Scope.maxNewElements(scope,0); | ||
69987 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
69988 | Type.name(type,"FunctionalData class"); | ||
69989 | } | ||
69990 | |||
69991 | /** | ||
69992 | * An element may be an instance of type "FunctionalData class". | ||
69993 | */ | ||
69994 | private pattern mayInstanceOfFunctionalData_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
69995 | { | ||
69996 | find interpretation(problem,interpretation); | ||
69997 | PartialInterpretation.newElements(interpretation,element); | ||
69998 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
69999 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
70000 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
70001 | neg find mustInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
70002 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
70003 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
70004 | neg find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
70005 | neg find scopeDisallowsNewFunctionalData_class(problem, interpretation); | ||
70006 | neg find isPrimitive(element); | ||
70007 | } or { | ||
70008 | find interpretation(problem,interpretation); | ||
70009 | PartialInterpretation.openWorldElements(interpretation,element); | ||
70010 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
70011 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
70012 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
70013 | neg find mustInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
70014 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
70015 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
70016 | neg find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
70017 | neg find scopeDisallowsNewFunctionalData_class(problem, interpretation); | ||
70018 | neg find isPrimitive(element); | ||
70019 | } or | ||
70020 | { find mustInstanceOfFunctionalData_class(problem,interpretation,element); } | ||
70021 | /** | ||
70022 | * An element must be an instance of type "FunctionType enum". | ||
70023 | */ | ||
70024 | private pattern mustInstanceOfFunctionType_enum(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
70025 | Type.name(type,"FunctionType enum"); | ||
70026 | find directInstanceOf(problem,interpretation,element,type); | ||
70027 | } | ||
70028 | private pattern scopeDisallowsNewFunctionType_enum(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
70029 | find interpretation(problem,interpretation); | ||
70030 | PartialInterpretation.scopes(interpretation,scope); | ||
70031 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
70032 | Scope.maxNewElements(scope,0); | ||
70033 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
70034 | Type.name(type,"FunctionType enum"); | ||
70035 | } | ||
70036 | |||
70037 | /** | ||
70038 | * An element may be an instance of type "FunctionType enum". | ||
70039 | */ | ||
70040 | private pattern mayInstanceOfFunctionType_enum(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
70041 | { find mustInstanceOfFunctionType_enum(problem,interpretation,element); } | ||
70042 | |||
70043 | ////////// | ||
70044 | // 1.2 Relation Declaration Indexers | ||
70045 | ////////// | ||
70046 | /** | ||
70047 | * Matcher for detecting tuples t where []interface reference FunctionalElement(source,target) | ||
70048 | */ | ||
70049 | private pattern mustInRelationinterface_reference_FunctionalElement( | ||
70050 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
70051 | source: DefinedElement, target:DefinedElement) | ||
70052 | { | ||
70053 | find interpretation(problem,interpretation); | ||
70054 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
70055 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"interface reference FunctionalElement"); | ||
70056 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
70057 | BinaryElementRelationLink.param1(link,source); | ||
70058 | BinaryElementRelationLink.param2(link,target); | ||
70059 | } | ||
70060 | /** | ||
70061 | * Matcher for detecting tuples t where <>interface reference FunctionalElement(source,target) | ||
70062 | */ | ||
70063 | private pattern mayInRelationinterface_reference_FunctionalElement( | ||
70064 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
70065 | source: DefinedElement, target:DefinedElement) | ||
70066 | { | ||
70067 | find interpretation(problem,interpretation); | ||
70068 | // The two endpoint of the link have to exist | ||
70069 | find mayExist(problem, interpretation, source); | ||
70070 | find mayExist(problem, interpretation, target); | ||
70071 | // Type consistency | ||
70072 | find mayInstanceOfFunctionalElement_class(problem,interpretation,source); | ||
70073 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,target); | ||
70074 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
70075 | // the upper bound of the multiplicity should be considered. | ||
70076 | numberOfExistingReferences == count find mustInRelationinterface_reference_FunctionalElement(problem,interpretation,source,_); | ||
70077 | check(numberOfExistingReferences < 1); | ||
70078 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
70079 | // the upper bound of the opposite reference multiplicity should be considered. | ||
70080 | numberOfExistingOppositeReferences == count find mustInRelationelement_reference_FunctionalInterface(problem,interpretation,target,_); | ||
70081 | check(numberOfExistingOppositeReferences < 1); | ||
70082 | // The reference is containment, then a new reference cannot be create if: | ||
70083 | // 1. Multiple parents | ||
70084 | neg find mustContains4(problem,interpretation,_,target); | ||
70085 | // 2. Circle in the containment hierarchy | ||
70086 | neg find mustTransitiveContains(source,target); | ||
70087 | } or { | ||
70088 | find mustInRelationinterface_reference_FunctionalElement(problem,interpretation,source,target); | ||
70089 | } | ||
70090 | /** | ||
70091 | * Matcher for detecting tuples t where []model reference FunctionalElement(source,target) | ||
70092 | */ | ||
70093 | private pattern mustInRelationmodel_reference_FunctionalElement( | ||
70094 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
70095 | source: DefinedElement, target:DefinedElement) | ||
70096 | { | ||
70097 | find interpretation(problem,interpretation); | ||
70098 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
70099 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"model reference FunctionalElement"); | ||
70100 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
70101 | BinaryElementRelationLink.param1(link,source); | ||
70102 | BinaryElementRelationLink.param2(link,target); | ||
70103 | } | ||
70104 | /** | ||
70105 | * Matcher for detecting tuples t where <>model reference FunctionalElement(source,target) | ||
70106 | */ | ||
70107 | private pattern mayInRelationmodel_reference_FunctionalElement( | ||
70108 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
70109 | source: DefinedElement, target:DefinedElement) | ||
70110 | { | ||
70111 | find interpretation(problem,interpretation); | ||
70112 | // The two endpoint of the link have to exist | ||
70113 | find mayExist(problem, interpretation, source); | ||
70114 | find mayExist(problem, interpretation, target); | ||
70115 | // Type consistency | ||
70116 | find mayInstanceOfFunctionalElement_class(problem,interpretation,source); | ||
70117 | find mayInstanceOfFunctionalArchitectureModel_class(problem,interpretation,target); | ||
70118 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
70119 | // the upper bound of the multiplicity should be considered. | ||
70120 | numberOfExistingReferences == count find mustInRelationmodel_reference_FunctionalElement(problem,interpretation,source,_); | ||
70121 | check(numberOfExistingReferences < 1); | ||
70122 | } or { | ||
70123 | find mustInRelationmodel_reference_FunctionalElement(problem,interpretation,source,target); | ||
70124 | } | ||
70125 | /** | ||
70126 | * Matcher for detecting tuples t where []parent reference FunctionalElement(source,target) | ||
70127 | */ | ||
70128 | private pattern mustInRelationparent_reference_FunctionalElement( | ||
70129 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
70130 | source: DefinedElement, target:DefinedElement) | ||
70131 | { | ||
70132 | find interpretation(problem,interpretation); | ||
70133 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
70134 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"parent reference FunctionalElement"); | ||
70135 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
70136 | BinaryElementRelationLink.param1(link,source); | ||
70137 | BinaryElementRelationLink.param2(link,target); | ||
70138 | } | ||
70139 | /** | ||
70140 | * Matcher for detecting tuples t where <>parent reference FunctionalElement(source,target) | ||
70141 | */ | ||
70142 | private pattern mayInRelationparent_reference_FunctionalElement( | ||
70143 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
70144 | source: DefinedElement, target:DefinedElement) | ||
70145 | { | ||
70146 | find interpretation(problem,interpretation); | ||
70147 | // The two endpoint of the link have to exist | ||
70148 | find mayExist(problem, interpretation, source); | ||
70149 | find mayExist(problem, interpretation, target); | ||
70150 | // Type consistency | ||
70151 | find mayInstanceOfFunctionalElement_class(problem,interpretation,source); | ||
70152 | find mayInstanceOfFunction_class(problem,interpretation,target); | ||
70153 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
70154 | // the upper bound of the multiplicity should be considered. | ||
70155 | numberOfExistingReferences == count find mustInRelationparent_reference_FunctionalElement(problem,interpretation,source,_); | ||
70156 | check(numberOfExistingReferences < 1); | ||
70157 | // The eOpposite of the reference is containment, then a referene cannot be created if | ||
70158 | // 1. Multiple parents | ||
70159 | neg find mustContains4(problem,interpretation,source,_); | ||
70160 | // 2. Circle in the containment hierarchy | ||
70161 | neg find mustTransitiveContains(source,target); | ||
70162 | } or { | ||
70163 | find mustInRelationparent_reference_FunctionalElement(problem,interpretation,source,target); | ||
70164 | } | ||
70165 | /** | ||
70166 | * Matcher for detecting tuples t where []rootElements reference FunctionalArchitectureModel(source,target) | ||
70167 | */ | ||
70168 | private pattern mustInRelationrootElements_reference_FunctionalArchitectureModel( | ||
70169 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
70170 | source: DefinedElement, target:DefinedElement) | ||
70171 | { | ||
70172 | find interpretation(problem,interpretation); | ||
70173 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
70174 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"rootElements reference FunctionalArchitectureModel"); | ||
70175 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
70176 | BinaryElementRelationLink.param1(link,source); | ||
70177 | BinaryElementRelationLink.param2(link,target); | ||
70178 | } | ||
70179 | /** | ||
70180 | * Matcher for detecting tuples t where <>rootElements reference FunctionalArchitectureModel(source,target) | ||
70181 | */ | ||
70182 | private pattern mayInRelationrootElements_reference_FunctionalArchitectureModel( | ||
70183 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
70184 | source: DefinedElement, target:DefinedElement) | ||
70185 | { | ||
70186 | find interpretation(problem,interpretation); | ||
70187 | // The two endpoint of the link have to exist | ||
70188 | find mayExist(problem, interpretation, source); | ||
70189 | find mayExist(problem, interpretation, target); | ||
70190 | // Type consistency | ||
70191 | find mayInstanceOfFunctionalArchitectureModel_class(problem,interpretation,source); | ||
70192 | find mayInstanceOfFunctionalElement_class(problem,interpretation,target); | ||
70193 | // The reference is containment, then a new reference cannot be create if: | ||
70194 | // 1. Multiple parents | ||
70195 | neg find mustContains4(problem,interpretation,_,target); | ||
70196 | // 2. Circle in the containment hierarchy | ||
70197 | neg find mustTransitiveContains(source,target); | ||
70198 | } or { | ||
70199 | find mustInRelationrootElements_reference_FunctionalArchitectureModel(problem,interpretation,source,target); | ||
70200 | } | ||
70201 | /** | ||
70202 | * Matcher for detecting tuples t where []subElements reference Function(source,target) | ||
70203 | */ | ||
70204 | private pattern mustInRelationsubElements_reference_Function( | ||
70205 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
70206 | source: DefinedElement, target:DefinedElement) | ||
70207 | { | ||
70208 | find interpretation(problem,interpretation); | ||
70209 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
70210 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"subElements reference Function"); | ||
70211 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
70212 | BinaryElementRelationLink.param1(link,source); | ||
70213 | BinaryElementRelationLink.param2(link,target); | ||
70214 | } | ||
70215 | /** | ||
70216 | * Matcher for detecting tuples t where <>subElements reference Function(source,target) | ||
70217 | */ | ||
70218 | private pattern mayInRelationsubElements_reference_Function( | ||
70219 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
70220 | source: DefinedElement, target:DefinedElement) | ||
70221 | { | ||
70222 | find interpretation(problem,interpretation); | ||
70223 | // The two endpoint of the link have to exist | ||
70224 | find mayExist(problem, interpretation, source); | ||
70225 | find mayExist(problem, interpretation, target); | ||
70226 | // Type consistency | ||
70227 | find mayInstanceOfFunction_class(problem,interpretation,source); | ||
70228 | find mayInstanceOfFunctionalElement_class(problem,interpretation,target); | ||
70229 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
70230 | // the upper bound of the opposite reference multiplicity should be considered. | ||
70231 | numberOfExistingOppositeReferences == count find mustInRelationparent_reference_FunctionalElement(problem,interpretation,target,_); | ||
70232 | check(numberOfExistingOppositeReferences < 1); | ||
70233 | // The reference is containment, then a new reference cannot be create if: | ||
70234 | // 1. Multiple parents | ||
70235 | neg find mustContains4(problem,interpretation,_,target); | ||
70236 | // 2. Circle in the containment hierarchy | ||
70237 | neg find mustTransitiveContains(source,target); | ||
70238 | } or { | ||
70239 | find mustInRelationsubElements_reference_Function(problem,interpretation,source,target); | ||
70240 | } | ||
70241 | /** | ||
70242 | * Matcher for detecting tuples t where []data reference FAMTerminator(source,target) | ||
70243 | */ | ||
70244 | private pattern mustInRelationdata_reference_FAMTerminator( | ||
70245 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
70246 | source: DefinedElement, target:DefinedElement) | ||
70247 | { | ||
70248 | find interpretation(problem,interpretation); | ||
70249 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
70250 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"data reference FAMTerminator"); | ||
70251 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
70252 | BinaryElementRelationLink.param1(link,source); | ||
70253 | BinaryElementRelationLink.param2(link,target); | ||
70254 | } | ||
70255 | /** | ||
70256 | * Matcher for detecting tuples t where <>data reference FAMTerminator(source,target) | ||
70257 | */ | ||
70258 | private pattern mayInRelationdata_reference_FAMTerminator( | ||
70259 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
70260 | source: DefinedElement, target:DefinedElement) | ||
70261 | { | ||
70262 | find interpretation(problem,interpretation); | ||
70263 | // The two endpoint of the link have to exist | ||
70264 | find mayExist(problem, interpretation, source); | ||
70265 | find mayExist(problem, interpretation, target); | ||
70266 | // Type consistency | ||
70267 | find mayInstanceOfFAMTerminator_class(problem,interpretation,source); | ||
70268 | find mayInstanceOfFunctionalData_class(problem,interpretation,target); | ||
70269 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
70270 | // the upper bound of the multiplicity should be considered. | ||
70271 | numberOfExistingReferences == count find mustInRelationdata_reference_FAMTerminator(problem,interpretation,source,_); | ||
70272 | check(numberOfExistingReferences < 1); | ||
70273 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
70274 | // the upper bound of the opposite reference multiplicity should be considered. | ||
70275 | numberOfExistingOppositeReferences == count find mustInRelationterminator_reference_FunctionalData(problem,interpretation,target,_); | ||
70276 | check(numberOfExistingOppositeReferences < 1); | ||
70277 | // The eOpposite of the reference is containment, then a referene cannot be created if | ||
70278 | // 1. Multiple parents | ||
70279 | neg find mustContains4(problem,interpretation,source,_); | ||
70280 | // 2. Circle in the containment hierarchy | ||
70281 | neg find mustTransitiveContains(source,target); | ||
70282 | } or { | ||
70283 | find mustInRelationdata_reference_FAMTerminator(problem,interpretation,source,target); | ||
70284 | } | ||
70285 | /** | ||
70286 | * Matcher for detecting tuples t where []from reference InformationLink(source,target) | ||
70287 | */ | ||
70288 | private pattern mustInRelationfrom_reference_InformationLink( | ||
70289 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
70290 | source: DefinedElement, target:DefinedElement) | ||
70291 | { | ||
70292 | find interpretation(problem,interpretation); | ||
70293 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
70294 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"from reference InformationLink"); | ||
70295 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
70296 | BinaryElementRelationLink.param1(link,source); | ||
70297 | BinaryElementRelationLink.param2(link,target); | ||
70298 | } | ||
70299 | /** | ||
70300 | * Matcher for detecting tuples t where <>from reference InformationLink(source,target) | ||
70301 | */ | ||
70302 | private pattern mayInRelationfrom_reference_InformationLink( | ||
70303 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
70304 | source: DefinedElement, target:DefinedElement) | ||
70305 | { | ||
70306 | find interpretation(problem,interpretation); | ||
70307 | // The two endpoint of the link have to exist | ||
70308 | find mayExist(problem, interpretation, source); | ||
70309 | find mayExist(problem, interpretation, target); | ||
70310 | // Type consistency | ||
70311 | find mayInstanceOfInformationLink_class(problem,interpretation,source); | ||
70312 | find mayInstanceOfFunctionalOutput_class(problem,interpretation,target); | ||
70313 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
70314 | // the upper bound of the multiplicity should be considered. | ||
70315 | numberOfExistingReferences == count find mustInRelationfrom_reference_InformationLink(problem,interpretation,source,_); | ||
70316 | check(numberOfExistingReferences < 1); | ||
70317 | // The eOpposite of the reference is containment, then a referene cannot be created if | ||
70318 | // 1. Multiple parents | ||
70319 | neg find mustContains4(problem,interpretation,source,_); | ||
70320 | // 2. Circle in the containment hierarchy | ||
70321 | neg find mustTransitiveContains(source,target); | ||
70322 | } or { | ||
70323 | find mustInRelationfrom_reference_InformationLink(problem,interpretation,source,target); | ||
70324 | } | ||
70325 | /** | ||
70326 | * Matcher for detecting tuples t where []to reference InformationLink(source,target) | ||
70327 | */ | ||
70328 | private pattern mustInRelationto_reference_InformationLink( | ||
70329 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
70330 | source: DefinedElement, target:DefinedElement) | ||
70331 | { | ||
70332 | find interpretation(problem,interpretation); | ||
70333 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
70334 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"to reference InformationLink"); | ||
70335 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
70336 | BinaryElementRelationLink.param1(link,source); | ||
70337 | BinaryElementRelationLink.param2(link,target); | ||
70338 | } | ||
70339 | /** | ||
70340 | * Matcher for detecting tuples t where <>to reference InformationLink(source,target) | ||
70341 | */ | ||
70342 | private pattern mayInRelationto_reference_InformationLink( | ||
70343 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
70344 | source: DefinedElement, target:DefinedElement) | ||
70345 | { | ||
70346 | find interpretation(problem,interpretation); | ||
70347 | // The two endpoint of the link have to exist | ||
70348 | find mayExist(problem, interpretation, source); | ||
70349 | find mayExist(problem, interpretation, target); | ||
70350 | // Type consistency | ||
70351 | find mayInstanceOfInformationLink_class(problem,interpretation,source); | ||
70352 | find mayInstanceOfFunctionalInput_class(problem,interpretation,target); | ||
70353 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
70354 | // the upper bound of the multiplicity should be considered. | ||
70355 | numberOfExistingReferences == count find mustInRelationto_reference_InformationLink(problem,interpretation,source,_); | ||
70356 | check(numberOfExistingReferences < 1); | ||
70357 | } or { | ||
70358 | find mustInRelationto_reference_InformationLink(problem,interpretation,source,target); | ||
70359 | } | ||
70360 | /** | ||
70361 | * Matcher for detecting tuples t where []data reference FunctionalInterface(source,target) | ||
70362 | */ | ||
70363 | private pattern mustInRelationdata_reference_FunctionalInterface( | ||
70364 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
70365 | source: DefinedElement, target:DefinedElement) | ||
70366 | { | ||
70367 | find interpretation(problem,interpretation); | ||
70368 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
70369 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"data reference FunctionalInterface"); | ||
70370 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
70371 | BinaryElementRelationLink.param1(link,source); | ||
70372 | BinaryElementRelationLink.param2(link,target); | ||
70373 | } | ||
70374 | /** | ||
70375 | * Matcher for detecting tuples t where <>data reference FunctionalInterface(source,target) | ||
70376 | */ | ||
70377 | private pattern mayInRelationdata_reference_FunctionalInterface( | ||
70378 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
70379 | source: DefinedElement, target:DefinedElement) | ||
70380 | { | ||
70381 | find interpretation(problem,interpretation); | ||
70382 | // The two endpoint of the link have to exist | ||
70383 | find mayExist(problem, interpretation, source); | ||
70384 | find mayExist(problem, interpretation, target); | ||
70385 | // Type consistency | ||
70386 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,source); | ||
70387 | find mayInstanceOfFunctionalData_class(problem,interpretation,target); | ||
70388 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
70389 | // the upper bound of the opposite reference multiplicity should be considered. | ||
70390 | numberOfExistingOppositeReferences == count find mustInRelationinterface_reference_FunctionalData(problem,interpretation,target,_); | ||
70391 | check(numberOfExistingOppositeReferences < 1); | ||
70392 | // The reference is containment, then a new reference cannot be create if: | ||
70393 | // 1. Multiple parents | ||
70394 | neg find mustContains4(problem,interpretation,_,target); | ||
70395 | // 2. Circle in the containment hierarchy | ||
70396 | neg find mustTransitiveContains(source,target); | ||
70397 | } or { | ||
70398 | find mustInRelationdata_reference_FunctionalInterface(problem,interpretation,source,target); | ||
70399 | } | ||
70400 | /** | ||
70401 | * Matcher for detecting tuples t where []element reference FunctionalInterface(source,target) | ||
70402 | */ | ||
70403 | private pattern mustInRelationelement_reference_FunctionalInterface( | ||
70404 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
70405 | source: DefinedElement, target:DefinedElement) | ||
70406 | { | ||
70407 | find interpretation(problem,interpretation); | ||
70408 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
70409 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"element reference FunctionalInterface"); | ||
70410 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
70411 | BinaryElementRelationLink.param1(link,source); | ||
70412 | BinaryElementRelationLink.param2(link,target); | ||
70413 | } | ||
70414 | /** | ||
70415 | * Matcher for detecting tuples t where <>element reference FunctionalInterface(source,target) | ||
70416 | */ | ||
70417 | private pattern mayInRelationelement_reference_FunctionalInterface( | ||
70418 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
70419 | source: DefinedElement, target:DefinedElement) | ||
70420 | { | ||
70421 | find interpretation(problem,interpretation); | ||
70422 | // The two endpoint of the link have to exist | ||
70423 | find mayExist(problem, interpretation, source); | ||
70424 | find mayExist(problem, interpretation, target); | ||
70425 | // Type consistency | ||
70426 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,source); | ||
70427 | find mayInstanceOfFunctionalElement_class(problem,interpretation,target); | ||
70428 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
70429 | // the upper bound of the multiplicity should be considered. | ||
70430 | numberOfExistingReferences == count find mustInRelationelement_reference_FunctionalInterface(problem,interpretation,source,_); | ||
70431 | check(numberOfExistingReferences < 1); | ||
70432 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
70433 | // the upper bound of the opposite reference multiplicity should be considered. | ||
70434 | numberOfExistingOppositeReferences == count find mustInRelationinterface_reference_FunctionalElement(problem,interpretation,target,_); | ||
70435 | check(numberOfExistingOppositeReferences < 1); | ||
70436 | // The eOpposite of the reference is containment, then a referene cannot be created if | ||
70437 | // 1. Multiple parents | ||
70438 | neg find mustContains4(problem,interpretation,source,_); | ||
70439 | // 2. Circle in the containment hierarchy | ||
70440 | neg find mustTransitiveContains(source,target); | ||
70441 | } or { | ||
70442 | find mustInRelationelement_reference_FunctionalInterface(problem,interpretation,source,target); | ||
70443 | } | ||
70444 | /** | ||
70445 | * Matcher for detecting tuples t where []IncomingLinks reference FunctionalInput(source,target) | ||
70446 | */ | ||
70447 | private pattern mustInRelationIncomingLinks_reference_FunctionalInput( | ||
70448 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
70449 | source: DefinedElement, target:DefinedElement) | ||
70450 | { | ||
70451 | find interpretation(problem,interpretation); | ||
70452 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
70453 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"IncomingLinks reference FunctionalInput"); | ||
70454 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
70455 | BinaryElementRelationLink.param1(link,source); | ||
70456 | BinaryElementRelationLink.param2(link,target); | ||
70457 | } | ||
70458 | /** | ||
70459 | * Matcher for detecting tuples t where <>IncomingLinks reference FunctionalInput(source,target) | ||
70460 | */ | ||
70461 | private pattern mayInRelationIncomingLinks_reference_FunctionalInput( | ||
70462 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
70463 | source: DefinedElement, target:DefinedElement) | ||
70464 | { | ||
70465 | find interpretation(problem,interpretation); | ||
70466 | // The two endpoint of the link have to exist | ||
70467 | find mayExist(problem, interpretation, source); | ||
70468 | find mayExist(problem, interpretation, target); | ||
70469 | // Type consistency | ||
70470 | find mayInstanceOfFunctionalInput_class(problem,interpretation,source); | ||
70471 | find mayInstanceOfInformationLink_class(problem,interpretation,target); | ||
70472 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
70473 | // the upper bound of the opposite reference multiplicity should be considered. | ||
70474 | numberOfExistingOppositeReferences == count find mustInRelationto_reference_InformationLink(problem,interpretation,target,_); | ||
70475 | check(numberOfExistingOppositeReferences < 1); | ||
70476 | } or { | ||
70477 | find mustInRelationIncomingLinks_reference_FunctionalInput(problem,interpretation,source,target); | ||
70478 | } | ||
70479 | /** | ||
70480 | * Matcher for detecting tuples t where []outgoingLinks reference FunctionalOutput(source,target) | ||
70481 | */ | ||
70482 | private pattern mustInRelationoutgoingLinks_reference_FunctionalOutput( | ||
70483 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
70484 | source: DefinedElement, target:DefinedElement) | ||
70485 | { | ||
70486 | find interpretation(problem,interpretation); | ||
70487 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
70488 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"outgoingLinks reference FunctionalOutput"); | ||
70489 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
70490 | BinaryElementRelationLink.param1(link,source); | ||
70491 | BinaryElementRelationLink.param2(link,target); | ||
70492 | } | ||
70493 | /** | ||
70494 | * Matcher for detecting tuples t where <>outgoingLinks reference FunctionalOutput(source,target) | ||
70495 | */ | ||
70496 | private pattern mayInRelationoutgoingLinks_reference_FunctionalOutput( | ||
70497 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
70498 | source: DefinedElement, target:DefinedElement) | ||
70499 | { | ||
70500 | find interpretation(problem,interpretation); | ||
70501 | // The two endpoint of the link have to exist | ||
70502 | find mayExist(problem, interpretation, source); | ||
70503 | find mayExist(problem, interpretation, target); | ||
70504 | // Type consistency | ||
70505 | find mayInstanceOfFunctionalOutput_class(problem,interpretation,source); | ||
70506 | find mayInstanceOfInformationLink_class(problem,interpretation,target); | ||
70507 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
70508 | // the upper bound of the opposite reference multiplicity should be considered. | ||
70509 | numberOfExistingOppositeReferences == count find mustInRelationfrom_reference_InformationLink(problem,interpretation,target,_); | ||
70510 | check(numberOfExistingOppositeReferences < 1); | ||
70511 | // The reference is containment, then a new reference cannot be create if: | ||
70512 | // 1. Multiple parents | ||
70513 | neg find mustContains4(problem,interpretation,_,target); | ||
70514 | // 2. Circle in the containment hierarchy | ||
70515 | neg find mustTransitiveContains(source,target); | ||
70516 | } or { | ||
70517 | find mustInRelationoutgoingLinks_reference_FunctionalOutput(problem,interpretation,source,target); | ||
70518 | } | ||
70519 | /** | ||
70520 | * Matcher for detecting tuples t where []terminator reference FunctionalData(source,target) | ||
70521 | */ | ||
70522 | private pattern mustInRelationterminator_reference_FunctionalData( | ||
70523 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
70524 | source: DefinedElement, target:DefinedElement) | ||
70525 | { | ||
70526 | find interpretation(problem,interpretation); | ||
70527 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
70528 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"terminator reference FunctionalData"); | ||
70529 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
70530 | BinaryElementRelationLink.param1(link,source); | ||
70531 | BinaryElementRelationLink.param2(link,target); | ||
70532 | } | ||
70533 | /** | ||
70534 | * Matcher for detecting tuples t where <>terminator reference FunctionalData(source,target) | ||
70535 | */ | ||
70536 | private pattern mayInRelationterminator_reference_FunctionalData( | ||
70537 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
70538 | source: DefinedElement, target:DefinedElement) | ||
70539 | { | ||
70540 | find interpretation(problem,interpretation); | ||
70541 | // The two endpoint of the link have to exist | ||
70542 | find mayExist(problem, interpretation, source); | ||
70543 | find mayExist(problem, interpretation, target); | ||
70544 | // Type consistency | ||
70545 | find mayInstanceOfFunctionalData_class(problem,interpretation,source); | ||
70546 | find mayInstanceOfFAMTerminator_class(problem,interpretation,target); | ||
70547 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
70548 | // the upper bound of the multiplicity should be considered. | ||
70549 | numberOfExistingReferences == count find mustInRelationterminator_reference_FunctionalData(problem,interpretation,source,_); | ||
70550 | check(numberOfExistingReferences < 1); | ||
70551 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
70552 | // the upper bound of the opposite reference multiplicity should be considered. | ||
70553 | numberOfExistingOppositeReferences == count find mustInRelationdata_reference_FAMTerminator(problem,interpretation,target,_); | ||
70554 | check(numberOfExistingOppositeReferences < 1); | ||
70555 | // The reference is containment, then a new reference cannot be create if: | ||
70556 | // 1. Multiple parents | ||
70557 | neg find mustContains4(problem,interpretation,_,target); | ||
70558 | // 2. Circle in the containment hierarchy | ||
70559 | neg find mustTransitiveContains(source,target); | ||
70560 | } or { | ||
70561 | find mustInRelationterminator_reference_FunctionalData(problem,interpretation,source,target); | ||
70562 | } | ||
70563 | /** | ||
70564 | * Matcher for detecting tuples t where []interface reference FunctionalData(source,target) | ||
70565 | */ | ||
70566 | private pattern mustInRelationinterface_reference_FunctionalData( | ||
70567 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
70568 | source: DefinedElement, target:DefinedElement) | ||
70569 | { | ||
70570 | find interpretation(problem,interpretation); | ||
70571 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
70572 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"interface reference FunctionalData"); | ||
70573 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
70574 | BinaryElementRelationLink.param1(link,source); | ||
70575 | BinaryElementRelationLink.param2(link,target); | ||
70576 | } | ||
70577 | /** | ||
70578 | * Matcher for detecting tuples t where <>interface reference FunctionalData(source,target) | ||
70579 | */ | ||
70580 | private pattern mayInRelationinterface_reference_FunctionalData( | ||
70581 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
70582 | source: DefinedElement, target:DefinedElement) | ||
70583 | { | ||
70584 | find interpretation(problem,interpretation); | ||
70585 | // The two endpoint of the link have to exist | ||
70586 | find mayExist(problem, interpretation, source); | ||
70587 | find mayExist(problem, interpretation, target); | ||
70588 | // Type consistency | ||
70589 | find mayInstanceOfFunctionalData_class(problem,interpretation,source); | ||
70590 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,target); | ||
70591 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
70592 | // the upper bound of the multiplicity should be considered. | ||
70593 | numberOfExistingReferences == count find mustInRelationinterface_reference_FunctionalData(problem,interpretation,source,_); | ||
70594 | check(numberOfExistingReferences < 1); | ||
70595 | // The eOpposite of the reference is containment, then a referene cannot be created if | ||
70596 | // 1. Multiple parents | ||
70597 | neg find mustContains4(problem,interpretation,source,_); | ||
70598 | // 2. Circle in the containment hierarchy | ||
70599 | neg find mustTransitiveContains(source,target); | ||
70600 | } or { | ||
70601 | find mustInRelationinterface_reference_FunctionalData(problem,interpretation,source,target); | ||
70602 | } | ||
70603 | /** | ||
70604 | * Matcher for detecting tuples t where []type attribute Function(source,target) | ||
70605 | */ | ||
70606 | private pattern mustInRelationtype_attribute_Function( | ||
70607 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
70608 | source: DefinedElement, target:DefinedElement) | ||
70609 | { | ||
70610 | find interpretation(problem,interpretation); | ||
70611 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
70612 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"type attribute Function"); | ||
70613 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
70614 | BinaryElementRelationLink.param1(link,source); | ||
70615 | BinaryElementRelationLink.param2(link,target); | ||
70616 | } | ||
70617 | /** | ||
70618 | * Matcher for detecting tuples t where <>type attribute Function(source,target) | ||
70619 | */ | ||
70620 | private pattern mayInRelationtype_attribute_Function( | ||
70621 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
70622 | source: DefinedElement, target:DefinedElement) | ||
70623 | { | ||
70624 | find interpretation(problem,interpretation); | ||
70625 | // The two endpoint of the link have to exist | ||
70626 | find mayExist(problem, interpretation, source); | ||
70627 | find mayExist(problem, interpretation, target); | ||
70628 | // Type consistency | ||
70629 | find mayInstanceOfFunction_class(problem,interpretation,source); | ||
70630 | find mayInstanceOfFunctionType_enum(problem,interpretation,target); | ||
70631 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
70632 | // the upper bound of the multiplicity should be considered. | ||
70633 | numberOfExistingReferences == count find mustInRelationtype_attribute_Function(problem,interpretation,source,_); | ||
70634 | check(numberOfExistingReferences < 1); | ||
70635 | } or { | ||
70636 | find mustInRelationtype_attribute_Function(problem,interpretation,source,target); | ||
70637 | } | ||
70638 | |||
70639 | ////////// | ||
70640 | // 1.3 Relation Definition Indexers | ||
70641 | ////////// | ||
70642 | |||
70643 | ////////// | ||
70644 | // 1.4 Containment Indexer | ||
70645 | ////////// | ||
70646 | private pattern mustContains2(source: DefinedElement, target: DefinedElement) { | ||
70647 | find mustContains4(_,_,source,target); | ||
70648 | } | ||
70649 | |||
70650 | private pattern mustContains4(problem:LogicProblem, interpretation:PartialInterpretation, | ||
70651 | source: DefinedElement, target: DefinedElement) | ||
70652 | { find mustInRelationinterface_reference_FunctionalElement(problem,interpretation,source,target); }or | ||
70653 | |||
70654 | { find mustInRelationrootElements_reference_FunctionalArchitectureModel(problem,interpretation,source,target); }or | ||
70655 | |||
70656 | { find mustInRelationsubElements_reference_Function(problem,interpretation,source,target); }or | ||
70657 | |||
70658 | { find mustInRelationdata_reference_FunctionalInterface(problem,interpretation,source,target); }or | ||
70659 | |||
70660 | { find mustInRelationoutgoingLinks_reference_FunctionalOutput(problem,interpretation,source,target); }or | ||
70661 | |||
70662 | { find mustInRelationterminator_reference_FunctionalData(problem,interpretation,source,target); } | ||
70663 | |||
70664 | private pattern mustTransitiveContains(source,target) { | ||
70665 | find mustContains2+(source,target); | ||
70666 | } | ||
70667 | |||
70668 | ////////// | ||
70669 | // 2. Invalidation Indexers | ||
70670 | ////////// | ||
70671 | // 2.1 Invalidated by WF Queries | ||
70672 | ////////// | ||
70673 | |||
70674 | ////////// | ||
70675 | // 3. Unfinishedness Indexers | ||
70676 | ////////// | ||
70677 | // 3.1 Unfinishedness Measured by Multiplicity | ||
70678 | ////////// | ||
70679 | pattern unfinishedLowerMultiplicity_model_reference_FunctionalElement(problem:LogicProblem, interpretation:PartialInterpretation, relationIterpretation:PartialRelationInterpretation, object:DefinedElement,missingMultiplicity) { | ||
70680 | find interpretation(problem,interpretation); | ||
70681 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
70682 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"model reference FunctionalElement"); | ||
70683 | find mustInstanceOfFunctionalElement_class(problem,interpretation,object); | ||
70684 | numberOfExistingReferences == count find mustInRelationmodel_reference_FunctionalElement(problem,interpretation,object,_); | ||
70685 | check(numberOfExistingReferences < 1); | ||
70686 | missingMultiplicity == eval(1-numberOfExistingReferences); | ||
70687 | } | ||
70688 | pattern unfinishedLowerMultiplicity_to_reference_InformationLink(problem:LogicProblem, interpretation:PartialInterpretation, relationIterpretation:PartialRelationInterpretation, object:DefinedElement,missingMultiplicity) { | ||
70689 | find interpretation(problem,interpretation); | ||
70690 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
70691 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"to reference InformationLink"); | ||
70692 | find mustInstanceOfInformationLink_class(problem,interpretation,object); | ||
70693 | numberOfExistingReferences == count find mustInRelationto_reference_InformationLink(problem,interpretation,object,_); | ||
70694 | check(numberOfExistingReferences < 1); | ||
70695 | missingMultiplicity == eval(1-numberOfExistingReferences); | ||
70696 | } | ||
70697 | pattern unfinishedLowerMultiplicity_type_attribute_Function(problem:LogicProblem, interpretation:PartialInterpretation, relationIterpretation:PartialRelationInterpretation, object:DefinedElement,missingMultiplicity) { | ||
70698 | find interpretation(problem,interpretation); | ||
70699 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
70700 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"type attribute Function"); | ||
70701 | find mustInstanceOfFunction_class(problem,interpretation,object); | ||
70702 | numberOfExistingReferences == count find mustInRelationtype_attribute_Function(problem,interpretation,object,_); | ||
70703 | check(numberOfExistingReferences < 1); | ||
70704 | missingMultiplicity == eval(1-numberOfExistingReferences); | ||
70705 | } | ||
70706 | |||
70707 | ////////// | ||
70708 | // 3.2 Unfinishedness Measured by WF Queries | ||
70709 | ////////// | ||
70710 | |||
70711 | ////////// | ||
70712 | // 4. Refinement Indexers | ||
70713 | ////////// | ||
70714 | // 4.1 Object constructors | ||
70715 | ////////// | ||
70716 | private pattern hasElementInContainment(problem:LogicProblem, interpretation:PartialInterpretation) | ||
70717 | { | ||
70718 | find interpretation(problem,interpretation); | ||
70719 | find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,root); | ||
70720 | find mustExist(problem, interpretation, root); | ||
70721 | }or{ | ||
70722 | find interpretation(problem,interpretation); | ||
70723 | find mustInstanceOfFunctionalInput_class(problem,interpretation,root); | ||
70724 | find mustExist(problem, interpretation, root); | ||
70725 | }or{ | ||
70726 | find interpretation(problem,interpretation); | ||
70727 | find mustInstanceOfFunctionalOutput_class(problem,interpretation,root); | ||
70728 | find mustExist(problem, interpretation, root); | ||
70729 | }or{ | ||
70730 | find interpretation(problem,interpretation); | ||
70731 | find mustInstanceOfFAMTerminator_class(problem,interpretation,root); | ||
70732 | find mustExist(problem, interpretation, root); | ||
70733 | }or{ | ||
70734 | find interpretation(problem,interpretation); | ||
70735 | find mustInstanceOfFunctionalInterface_class(problem,interpretation,root); | ||
70736 | find mustExist(problem, interpretation, root); | ||
70737 | }or{ | ||
70738 | find interpretation(problem,interpretation); | ||
70739 | find mustInstanceOfFunction_class(problem,interpretation,root); | ||
70740 | find mustExist(problem, interpretation, root); | ||
70741 | }or{ | ||
70742 | find interpretation(problem,interpretation); | ||
70743 | find mustInstanceOfInformationLink_class(problem,interpretation,root); | ||
70744 | find mustExist(problem, interpretation, root); | ||
70745 | }or{ | ||
70746 | find interpretation(problem,interpretation); | ||
70747 | find mustInstanceOfFunctionalElement_class(problem,interpretation,root); | ||
70748 | find mustExist(problem, interpretation, root); | ||
70749 | }or{ | ||
70750 | find interpretation(problem,interpretation); | ||
70751 | find mustInstanceOfFunctionalData_class(problem,interpretation,root); | ||
70752 | find mustExist(problem, interpretation, root); | ||
70753 | } | ||
70754 | pattern createObject_FAMTerminator_class_by_terminator_reference_FunctionalData_with_data_reference_FAMTerminator( | ||
70755 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
70756 | relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
70757 | container:DefinedElement) | ||
70758 | { | ||
70759 | find interpretation(problem,interpretation); | ||
70760 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
70761 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FAMTerminator class"); | ||
70762 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
70763 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"terminator reference FunctionalData"); | ||
70764 | PartialInterpretation.partialrelationinterpretation(interpretation,inverseInterpretation); | ||
70765 | PartialRelationInterpretation.interpretationOf.name(inverseInterpretation,"data reference FAMTerminator"); | ||
70766 | find mustInstanceOfFunctionalData_class(problem,interpretation,container); | ||
70767 | find mayInstanceOfFAMTerminator_class(problem,interpretation,newObject); | ||
70768 | find mayInRelationterminator_reference_FunctionalData(problem,interpretation,container,newObject); | ||
70769 | find mustExist(problem, interpretation, container); | ||
70770 | neg find mustExist(problem, interpretation, newObject); | ||
70771 | } | ||
70772 | pattern createObject_FAMTerminator_class( | ||
70773 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
70774 | typeInterpretation:PartialComplexTypeInterpretation) | ||
70775 | { | ||
70776 | find interpretation(problem,interpretation); | ||
70777 | neg find hasElementInContainment(problem,interpretation); | ||
70778 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
70779 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FAMTerminator class"); | ||
70780 | find mayInstanceOfFAMTerminator_class(problem,interpretation,newObject); | ||
70781 | find mayExist(problem, interpretation, newObject); | ||
70782 | neg find mustExist(problem, interpretation, newObject); | ||
70783 | } | ||
70784 | pattern createObject_FunctionalInterface_class_by_interface_reference_FunctionalElement_with_element_reference_FunctionalInterface( | ||
70785 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
70786 | relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
70787 | container:DefinedElement) | ||
70788 | { | ||
70789 | find interpretation(problem,interpretation); | ||
70790 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
70791 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalInterface class"); | ||
70792 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
70793 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"interface reference FunctionalElement"); | ||
70794 | PartialInterpretation.partialrelationinterpretation(interpretation,inverseInterpretation); | ||
70795 | PartialRelationInterpretation.interpretationOf.name(inverseInterpretation,"element reference FunctionalInterface"); | ||
70796 | find mustInstanceOfFunctionalElement_class(problem,interpretation,container); | ||
70797 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,newObject); | ||
70798 | find mayInRelationinterface_reference_FunctionalElement(problem,interpretation,container,newObject); | ||
70799 | find mustExist(problem, interpretation, container); | ||
70800 | neg find mustExist(problem, interpretation, newObject); | ||
70801 | } | ||
70802 | pattern createObject_FunctionalInterface_class( | ||
70803 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
70804 | typeInterpretation:PartialComplexTypeInterpretation) | ||
70805 | { | ||
70806 | find interpretation(problem,interpretation); | ||
70807 | neg find hasElementInContainment(problem,interpretation); | ||
70808 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
70809 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalInterface class"); | ||
70810 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,newObject); | ||
70811 | find mayExist(problem, interpretation, newObject); | ||
70812 | neg find mustExist(problem, interpretation, newObject); | ||
70813 | } | ||
70814 | pattern createObject_FunctionalInput_class_by_data_reference_FunctionalInterface_with_interface_reference_FunctionalData( | ||
70815 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
70816 | relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
70817 | container:DefinedElement) | ||
70818 | { | ||
70819 | find interpretation(problem,interpretation); | ||
70820 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
70821 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalInput class"); | ||
70822 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
70823 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"data reference FunctionalInterface"); | ||
70824 | PartialInterpretation.partialrelationinterpretation(interpretation,inverseInterpretation); | ||
70825 | PartialRelationInterpretation.interpretationOf.name(inverseInterpretation,"interface reference FunctionalData"); | ||
70826 | find mustInstanceOfFunctionalInterface_class(problem,interpretation,container); | ||
70827 | find mayInstanceOfFunctionalInput_class(problem,interpretation,newObject); | ||
70828 | find mayInRelationdata_reference_FunctionalInterface(problem,interpretation,container,newObject); | ||
70829 | find mustExist(problem, interpretation, container); | ||
70830 | neg find mustExist(problem, interpretation, newObject); | ||
70831 | } | ||
70832 | pattern createObject_FunctionalInput_class( | ||
70833 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
70834 | typeInterpretation:PartialComplexTypeInterpretation) | ||
70835 | { | ||
70836 | find interpretation(problem,interpretation); | ||
70837 | neg find hasElementInContainment(problem,interpretation); | ||
70838 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
70839 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalInput class"); | ||
70840 | find mayInstanceOfFunctionalInput_class(problem,interpretation,newObject); | ||
70841 | find mayExist(problem, interpretation, newObject); | ||
70842 | neg find mustExist(problem, interpretation, newObject); | ||
70843 | } | ||
70844 | pattern createObject_Function_class_by_rootElements_reference_FunctionalArchitectureModel( | ||
70845 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
70846 | relationInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
70847 | container:DefinedElement) | ||
70848 | { | ||
70849 | find interpretation(problem,interpretation); | ||
70850 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
70851 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"Function class"); | ||
70852 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
70853 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"rootElements reference FunctionalArchitectureModel"); | ||
70854 | find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,container); | ||
70855 | find mayInstanceOfFunction_class(problem,interpretation,newObject); | ||
70856 | find mayInRelationrootElements_reference_FunctionalArchitectureModel(problem,interpretation,container,newObject); | ||
70857 | find mustExist(problem, interpretation, container); | ||
70858 | neg find mustExist(problem, interpretation, newObject); | ||
70859 | } | ||
70860 | pattern createObject_Function_class_by_subElements_reference_Function_with_parent_reference_FunctionalElement( | ||
70861 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
70862 | relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
70863 | container:DefinedElement) | ||
70864 | { | ||
70865 | find interpretation(problem,interpretation); | ||
70866 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
70867 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"Function class"); | ||
70868 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
70869 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"subElements reference Function"); | ||
70870 | PartialInterpretation.partialrelationinterpretation(interpretation,inverseInterpretation); | ||
70871 | PartialRelationInterpretation.interpretationOf.name(inverseInterpretation,"parent reference FunctionalElement"); | ||
70872 | find mustInstanceOfFunction_class(problem,interpretation,container); | ||
70873 | find mayInstanceOfFunction_class(problem,interpretation,newObject); | ||
70874 | find mayInRelationsubElements_reference_Function(problem,interpretation,container,newObject); | ||
70875 | find mustExist(problem, interpretation, container); | ||
70876 | neg find mustExist(problem, interpretation, newObject); | ||
70877 | } | ||
70878 | pattern createObject_Function_class( | ||
70879 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
70880 | typeInterpretation:PartialComplexTypeInterpretation) | ||
70881 | { | ||
70882 | find interpretation(problem,interpretation); | ||
70883 | neg find hasElementInContainment(problem,interpretation); | ||
70884 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
70885 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"Function class"); | ||
70886 | find mayInstanceOfFunction_class(problem,interpretation,newObject); | ||
70887 | find mayExist(problem, interpretation, newObject); | ||
70888 | neg find mustExist(problem, interpretation, newObject); | ||
70889 | } | ||
70890 | pattern createObject_InformationLink_class_by_outgoingLinks_reference_FunctionalOutput_with_from_reference_InformationLink( | ||
70891 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
70892 | relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
70893 | container:DefinedElement) | ||
70894 | { | ||
70895 | find interpretation(problem,interpretation); | ||
70896 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
70897 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"InformationLink class"); | ||
70898 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
70899 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"outgoingLinks reference FunctionalOutput"); | ||
70900 | PartialInterpretation.partialrelationinterpretation(interpretation,inverseInterpretation); | ||
70901 | PartialRelationInterpretation.interpretationOf.name(inverseInterpretation,"from reference InformationLink"); | ||
70902 | find mustInstanceOfFunctionalOutput_class(problem,interpretation,container); | ||
70903 | find mayInstanceOfInformationLink_class(problem,interpretation,newObject); | ||
70904 | find mayInRelationoutgoingLinks_reference_FunctionalOutput(problem,interpretation,container,newObject); | ||
70905 | find mustExist(problem, interpretation, container); | ||
70906 | neg find mustExist(problem, interpretation, newObject); | ||
70907 | } | ||
70908 | pattern createObject_InformationLink_class( | ||
70909 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
70910 | typeInterpretation:PartialComplexTypeInterpretation) | ||
70911 | { | ||
70912 | find interpretation(problem,interpretation); | ||
70913 | neg find hasElementInContainment(problem,interpretation); | ||
70914 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
70915 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"InformationLink class"); | ||
70916 | find mayInstanceOfInformationLink_class(problem,interpretation,newObject); | ||
70917 | find mayExist(problem, interpretation, newObject); | ||
70918 | neg find mustExist(problem, interpretation, newObject); | ||
70919 | } | ||
70920 | pattern createObject_FunctionalArchitectureModel_class( | ||
70921 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
70922 | typeInterpretation:PartialComplexTypeInterpretation) | ||
70923 | { | ||
70924 | find interpretation(problem,interpretation); | ||
70925 | neg find hasElementInContainment(problem,interpretation); | ||
70926 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
70927 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalArchitectureModel class"); | ||
70928 | find mayInstanceOfFunctionalArchitectureModel_class(problem,interpretation,newObject); | ||
70929 | find mayExist(problem, interpretation, newObject); | ||
70930 | neg find mustExist(problem, interpretation, newObject); | ||
70931 | } | ||
70932 | pattern createObject_FunctionalOutput_class_by_data_reference_FunctionalInterface_with_interface_reference_FunctionalData( | ||
70933 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
70934 | relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
70935 | container:DefinedElement) | ||
70936 | { | ||
70937 | find interpretation(problem,interpretation); | ||
70938 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
70939 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalOutput class"); | ||
70940 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
70941 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"data reference FunctionalInterface"); | ||
70942 | PartialInterpretation.partialrelationinterpretation(interpretation,inverseInterpretation); | ||
70943 | PartialRelationInterpretation.interpretationOf.name(inverseInterpretation,"interface reference FunctionalData"); | ||
70944 | find mustInstanceOfFunctionalInterface_class(problem,interpretation,container); | ||
70945 | find mayInstanceOfFunctionalOutput_class(problem,interpretation,newObject); | ||
70946 | find mayInRelationdata_reference_FunctionalInterface(problem,interpretation,container,newObject); | ||
70947 | find mustExist(problem, interpretation, container); | ||
70948 | neg find mustExist(problem, interpretation, newObject); | ||
70949 | } | ||
70950 | pattern createObject_FunctionalOutput_class( | ||
70951 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
70952 | typeInterpretation:PartialComplexTypeInterpretation) | ||
70953 | { | ||
70954 | find interpretation(problem,interpretation); | ||
70955 | neg find hasElementInContainment(problem,interpretation); | ||
70956 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
70957 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalOutput class"); | ||
70958 | find mayInstanceOfFunctionalOutput_class(problem,interpretation,newObject); | ||
70959 | find mayExist(problem, interpretation, newObject); | ||
70960 | neg find mustExist(problem, interpretation, newObject); | ||
70961 | } | ||
70962 | |||
70963 | ////////// | ||
70964 | // 4.2 Type refinement | ||
70965 | ////////// | ||
70966 | pattern refineTypeTo_FAMTerminator_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
70967 | find interpretation(problem,interpretation); | ||
70968 | PartialInterpretation.newElements(interpretation,element); | ||
70969 | find mayInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
70970 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
70971 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
70972 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
70973 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
70974 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
70975 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
70976 | } | ||
70977 | pattern refineTypeTo_FunctionalInterface_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
70978 | find interpretation(problem,interpretation); | ||
70979 | PartialInterpretation.newElements(interpretation,element); | ||
70980 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
70981 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
70982 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
70983 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
70984 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
70985 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
70986 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
70987 | } | ||
70988 | pattern refineTypeTo_FunctionalInput_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
70989 | find interpretation(problem,interpretation); | ||
70990 | PartialInterpretation.newElements(interpretation,element); | ||
70991 | find mayInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
70992 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
70993 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
70994 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
70995 | neg find mustInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
70996 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
70997 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
70998 | neg find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
70999 | } | ||
71000 | pattern refineTypeTo_Function_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
71001 | find interpretation(problem,interpretation); | ||
71002 | PartialInterpretation.newElements(interpretation,element); | ||
71003 | find mayInstanceOfFunction_class(problem,interpretation,element); | ||
71004 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
71005 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
71006 | neg find mustInstanceOfFunction_class(problem,interpretation,element); | ||
71007 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
71008 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
71009 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
71010 | } | ||
71011 | pattern refineTypeTo_InformationLink_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
71012 | find interpretation(problem,interpretation); | ||
71013 | PartialInterpretation.newElements(interpretation,element); | ||
71014 | find mayInstanceOfInformationLink_class(problem,interpretation,element); | ||
71015 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
71016 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
71017 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
71018 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
71019 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
71020 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
71021 | } | ||
71022 | pattern refineTypeTo_FunctionalArchitectureModel_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
71023 | find interpretation(problem,interpretation); | ||
71024 | PartialInterpretation.newElements(interpretation,element); | ||
71025 | find mayInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
71026 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
71027 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
71028 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
71029 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
71030 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
71031 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
71032 | } | ||
71033 | pattern refineTypeTo_FunctionalOutput_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
71034 | find interpretation(problem,interpretation); | ||
71035 | PartialInterpretation.newElements(interpretation,element); | ||
71036 | find mayInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
71037 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
71038 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
71039 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
71040 | neg find mustInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
71041 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
71042 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
71043 | neg find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
71044 | } | ||
71045 | |||
71046 | ////////// | ||
71047 | // 4.3 Relation refinement | ||
71048 | ////////// | ||
71049 | pattern refineRelation_model_reference_FunctionalElement( | ||
71050 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
71051 | relationIterpretation:PartialRelationInterpretation, | ||
71052 | from: DefinedElement, to: DefinedElement) | ||
71053 | { | ||
71054 | find interpretation(problem,interpretation); | ||
71055 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
71056 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"model reference FunctionalElement"); | ||
71057 | find mustExist(problem, interpretation, from); | ||
71058 | find mustExist(problem, interpretation, to); | ||
71059 | find mustInstanceOfFunctionalElement_class(problem,interpretation,from); | ||
71060 | find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,to); | ||
71061 | find mayInRelationmodel_reference_FunctionalElement(problem,interpretation,from,to); | ||
71062 | neg find mustInRelationmodel_reference_FunctionalElement(problem,interpretation,from,to); | ||
71063 | } | ||
71064 | pattern refineRelation_IncomingLinks_reference_FunctionalInput_and_to_reference_InformationLink( | ||
71065 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
71066 | relationIterpretation:PartialRelationInterpretation, oppositeInterpretation:PartialRelationInterpretation, | ||
71067 | from: DefinedElement, to: DefinedElement) | ||
71068 | { | ||
71069 | find interpretation(problem,interpretation); | ||
71070 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
71071 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"IncomingLinks reference FunctionalInput"); | ||
71072 | PartialInterpretation.partialrelationinterpretation(interpretation,oppositeInterpretation); | ||
71073 | PartialRelationInterpretation.interpretationOf.name(oppositeInterpretation,"to reference InformationLink"); | ||
71074 | find mustExist(problem, interpretation, from); | ||
71075 | find mustExist(problem, interpretation, to); | ||
71076 | find mustInstanceOfFunctionalInput_class(problem,interpretation,from); | ||
71077 | find mustInstanceOfInformationLink_class(problem,interpretation,to); | ||
71078 | find mayInRelationIncomingLinks_reference_FunctionalInput(problem,interpretation,from,to); | ||
71079 | neg find mustInRelationIncomingLinks_reference_FunctionalInput(problem,interpretation,from,to); | ||
71080 | } | ||
71081 | pattern refineRelation_type_attribute_Function( | ||
71082 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
71083 | relationIterpretation:PartialRelationInterpretation, | ||
71084 | from: DefinedElement, to: DefinedElement) | ||
71085 | { | ||
71086 | find interpretation(problem,interpretation); | ||
71087 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
71088 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"type attribute Function"); | ||
71089 | find mustExist(problem, interpretation, from); | ||
71090 | find mustExist(problem, interpretation, to); | ||
71091 | find mustInstanceOfFunction_class(problem,interpretation,from); | ||
71092 | find mustInstanceOfFunctionType_enum(problem,interpretation,to); | ||
71093 | find mayInRelationtype_attribute_Function(problem,interpretation,from,to); | ||
71094 | neg find mustInRelationtype_attribute_Function(problem,interpretation,from,to); | ||
71095 | } | ||
71096 | import epackage "http://www.bme.hu/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage" | ||
71097 | import epackage "http://www.bme.hu/mit/inf/dslreasoner/logic/model/problem" | ||
71098 | import epackage "http://www.bme.hu/mit/inf/dslreasoner/logic/model/language" | ||
71099 | |||
71100 | ////////// | ||
71101 | // 0. Util | ||
71102 | ////////// | ||
71103 | private pattern interpretation(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
71104 | PartialInterpretation.problem(interpretation,problem); | ||
71105 | } | ||
71106 | |||
71107 | ///////////////////////// | ||
71108 | // 0.1 Existence | ||
71109 | ///////////////////////// | ||
71110 | private pattern mustExist(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
71111 | find interpretation(problem,interpretation); | ||
71112 | LogicProblem.elements(problem,element); | ||
71113 | } or { | ||
71114 | find interpretation(problem,interpretation); | ||
71115 | PartialInterpretation.newElements(interpretation,element); | ||
71116 | } | ||
71117 | |||
71118 | private pattern mayExist(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
71119 | find mustExist(problem,interpretation,element); | ||
71120 | } or { | ||
71121 | find interpretation(problem,interpretation); | ||
71122 | neg find elementCloseWorld(element); | ||
71123 | PartialInterpretation.openWorldElements(interpretation,element); | ||
71124 | } | ||
71125 | |||
71126 | private pattern elementCloseWorld(element:DefinedElement) { | ||
71127 | PartialInterpretation.openWorldElements(i,element); | ||
71128 | PartialInterpretation.maxNewElements(i,0); | ||
71129 | } or { | ||
71130 | Scope.targetTypeInterpretation(scope,interpretation); | ||
71131 | PartialTypeInterpratation.elements(interpretation,element); | ||
71132 | Scope.maxNewElements(scope,0); | ||
71133 | } | ||
71134 | |||
71135 | //////////////////////// | ||
71136 | // 0.2 Equivalence | ||
71137 | //////////////////////// | ||
71138 | pattern mayEquivalent(problem:LogicProblem, interpretation:PartialInterpretation, a: DefinedElement, b: DefinedElement) { | ||
71139 | find mayExist(problem,interpretation,a); | ||
71140 | find mayExist(problem,interpretation,b); | ||
71141 | a == b; | ||
71142 | } | ||
71143 | |||
71144 | //////////////////////// | ||
71145 | // 0.3 Required Patterns by TypeIndexer | ||
71146 | //////////////////////// | ||
71147 | private pattern typeInterpretation(problem:LogicProblem, interpretation:PartialInterpretation, type:TypeDeclaration, typeInterpretation:PartialComplexTypeInterpretation) { | ||
71148 | find interpretation(problem,interpretation); | ||
71149 | LogicProblem.types(problem,type); | ||
71150 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
71151 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
71152 | } | ||
71153 | |||
71154 | private pattern directInstanceOf(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement, type:Type) { | ||
71155 | find interpretation(problem,interpretation); | ||
71156 | LogicProblem.types(problem,type); | ||
71157 | TypeDefinition.elements(type,element); | ||
71158 | } or { | ||
71159 | find interpretation(problem,interpretation); | ||
71160 | find typeInterpretation(problem,interpretation,type,typeInterpretation); | ||
71161 | PartialComplexTypeInterpretation.elements(typeInterpretation,element); | ||
71162 | } | ||
71163 | |||
71164 | private pattern isPrimitive(element: PrimitiveElement) { | ||
71165 | PrimitiveElement(element); | ||
71166 | } | ||
71167 | |||
71168 | ////////// | ||
71169 | // 1. Problem-Specific Base Indexers | ||
71170 | ////////// | ||
71171 | // 1.1 Type Indexers | ||
71172 | ////////// | ||
71173 | // 1.1.1 primitive Type Indexers | ||
71174 | ////////// | ||
71175 | |||
71176 | ////////// | ||
71177 | // 1.1.2 domain-specific Type Indexers | ||
71178 | ////////// | ||
71179 | /** | ||
71180 | * An element must be an instance of type "FunctionalElement class". | ||
71181 | */ | ||
71182 | private pattern mustInstanceOfFunctionalElement_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
71183 | Type.name(type,"FunctionalElement class"); | ||
71184 | find directInstanceOf(problem,interpretation,element,type); | ||
71185 | } | ||
71186 | private pattern scopeDisallowsNewFunctionalElement_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
71187 | find interpretation(problem,interpretation); | ||
71188 | PartialInterpretation.scopes(interpretation,scope); | ||
71189 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
71190 | Scope.maxNewElements(scope,0); | ||
71191 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
71192 | Type.name(type,"FunctionalElement class"); | ||
71193 | } | ||
71194 | |||
71195 | /** | ||
71196 | * An element may be an instance of type "FunctionalElement class". | ||
71197 | */ | ||
71198 | private pattern mayInstanceOfFunctionalElement_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
71199 | { | ||
71200 | find interpretation(problem,interpretation); | ||
71201 | PartialInterpretation.newElements(interpretation,element); | ||
71202 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
71203 | neg find mustInstanceOfFunction_class(problem,interpretation,element); | ||
71204 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
71205 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
71206 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
71207 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
71208 | neg find scopeDisallowsNewFunctionalElement_class(problem, interpretation); | ||
71209 | neg find isPrimitive(element); | ||
71210 | } or { | ||
71211 | find interpretation(problem,interpretation); | ||
71212 | PartialInterpretation.openWorldElements(interpretation,element); | ||
71213 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
71214 | neg find mustInstanceOfFunction_class(problem,interpretation,element); | ||
71215 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
71216 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
71217 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
71218 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
71219 | neg find scopeDisallowsNewFunctionalElement_class(problem, interpretation); | ||
71220 | neg find isPrimitive(element); | ||
71221 | } or | ||
71222 | { find mustInstanceOfFunctionalElement_class(problem,interpretation,element); } | ||
71223 | /** | ||
71224 | * An element must be an instance of type "FunctionalArchitectureModel class". | ||
71225 | */ | ||
71226 | private pattern mustInstanceOfFunctionalArchitectureModel_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
71227 | Type.name(type,"FunctionalArchitectureModel class"); | ||
71228 | find directInstanceOf(problem,interpretation,element,type); | ||
71229 | } | ||
71230 | private pattern scopeDisallowsNewFunctionalArchitectureModel_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
71231 | find interpretation(problem,interpretation); | ||
71232 | PartialInterpretation.scopes(interpretation,scope); | ||
71233 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
71234 | Scope.maxNewElements(scope,0); | ||
71235 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
71236 | Type.name(type,"FunctionalArchitectureModel class"); | ||
71237 | } | ||
71238 | |||
71239 | /** | ||
71240 | * An element may be an instance of type "FunctionalArchitectureModel class". | ||
71241 | */ | ||
71242 | private pattern mayInstanceOfFunctionalArchitectureModel_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
71243 | { | ||
71244 | find interpretation(problem,interpretation); | ||
71245 | PartialInterpretation.newElements(interpretation,element); | ||
71246 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
71247 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
71248 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
71249 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
71250 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
71251 | neg find scopeDisallowsNewFunctionalArchitectureModel_class(problem, interpretation); | ||
71252 | neg find isPrimitive(element); | ||
71253 | } or { | ||
71254 | find interpretation(problem,interpretation); | ||
71255 | PartialInterpretation.openWorldElements(interpretation,element); | ||
71256 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
71257 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
71258 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
71259 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
71260 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
71261 | neg find scopeDisallowsNewFunctionalArchitectureModel_class(problem, interpretation); | ||
71262 | neg find isPrimitive(element); | ||
71263 | } or | ||
71264 | { find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); } | ||
71265 | /** | ||
71266 | * An element must be an instance of type "Function class". | ||
71267 | */ | ||
71268 | private pattern mustInstanceOfFunction_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
71269 | Type.name(type,"Function class"); | ||
71270 | find directInstanceOf(problem,interpretation,element,type); | ||
71271 | } | ||
71272 | private pattern scopeDisallowsNewFunction_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
71273 | find interpretation(problem,interpretation); | ||
71274 | PartialInterpretation.scopes(interpretation,scope); | ||
71275 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
71276 | Scope.maxNewElements(scope,0); | ||
71277 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
71278 | Type.name(type,"Function class"); | ||
71279 | } | ||
71280 | |||
71281 | /** | ||
71282 | * An element may be an instance of type "Function class". | ||
71283 | */ | ||
71284 | private pattern mayInstanceOfFunction_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
71285 | { | ||
71286 | find interpretation(problem,interpretation); | ||
71287 | PartialInterpretation.newElements(interpretation,element); | ||
71288 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
71289 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
71290 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
71291 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
71292 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
71293 | neg find scopeDisallowsNewFunction_class(problem, interpretation); | ||
71294 | neg find isPrimitive(element); | ||
71295 | } or { | ||
71296 | find interpretation(problem,interpretation); | ||
71297 | PartialInterpretation.openWorldElements(interpretation,element); | ||
71298 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
71299 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
71300 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
71301 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
71302 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
71303 | neg find scopeDisallowsNewFunction_class(problem, interpretation); | ||
71304 | neg find isPrimitive(element); | ||
71305 | } or | ||
71306 | { find mustInstanceOfFunction_class(problem,interpretation,element); } | ||
71307 | /** | ||
71308 | * An element must be an instance of type "FAMTerminator class". | ||
71309 | */ | ||
71310 | private pattern mustInstanceOfFAMTerminator_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
71311 | Type.name(type,"FAMTerminator class"); | ||
71312 | find directInstanceOf(problem,interpretation,element,type); | ||
71313 | } | ||
71314 | private pattern scopeDisallowsNewFAMTerminator_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
71315 | find interpretation(problem,interpretation); | ||
71316 | PartialInterpretation.scopes(interpretation,scope); | ||
71317 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
71318 | Scope.maxNewElements(scope,0); | ||
71319 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
71320 | Type.name(type,"FAMTerminator class"); | ||
71321 | } | ||
71322 | |||
71323 | /** | ||
71324 | * An element may be an instance of type "FAMTerminator class". | ||
71325 | */ | ||
71326 | private pattern mayInstanceOfFAMTerminator_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
71327 | { | ||
71328 | find interpretation(problem,interpretation); | ||
71329 | PartialInterpretation.newElements(interpretation,element); | ||
71330 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
71331 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
71332 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
71333 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
71334 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
71335 | neg find scopeDisallowsNewFAMTerminator_class(problem, interpretation); | ||
71336 | neg find isPrimitive(element); | ||
71337 | } or { | ||
71338 | find interpretation(problem,interpretation); | ||
71339 | PartialInterpretation.openWorldElements(interpretation,element); | ||
71340 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
71341 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
71342 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
71343 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
71344 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
71345 | neg find scopeDisallowsNewFAMTerminator_class(problem, interpretation); | ||
71346 | neg find isPrimitive(element); | ||
71347 | } or | ||
71348 | { find mustInstanceOfFAMTerminator_class(problem,interpretation,element); } | ||
71349 | /** | ||
71350 | * An element must be an instance of type "InformationLink class". | ||
71351 | */ | ||
71352 | private pattern mustInstanceOfInformationLink_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
71353 | Type.name(type,"InformationLink class"); | ||
71354 | find directInstanceOf(problem,interpretation,element,type); | ||
71355 | } | ||
71356 | private pattern scopeDisallowsNewInformationLink_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
71357 | find interpretation(problem,interpretation); | ||
71358 | PartialInterpretation.scopes(interpretation,scope); | ||
71359 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
71360 | Scope.maxNewElements(scope,0); | ||
71361 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
71362 | Type.name(type,"InformationLink class"); | ||
71363 | } | ||
71364 | |||
71365 | /** | ||
71366 | * An element may be an instance of type "InformationLink class". | ||
71367 | */ | ||
71368 | private pattern mayInstanceOfInformationLink_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
71369 | { | ||
71370 | find interpretation(problem,interpretation); | ||
71371 | PartialInterpretation.newElements(interpretation,element); | ||
71372 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
71373 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
71374 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
71375 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
71376 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
71377 | neg find scopeDisallowsNewInformationLink_class(problem, interpretation); | ||
71378 | neg find isPrimitive(element); | ||
71379 | } or { | ||
71380 | find interpretation(problem,interpretation); | ||
71381 | PartialInterpretation.openWorldElements(interpretation,element); | ||
71382 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
71383 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
71384 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
71385 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
71386 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
71387 | neg find scopeDisallowsNewInformationLink_class(problem, interpretation); | ||
71388 | neg find isPrimitive(element); | ||
71389 | } or | ||
71390 | { find mustInstanceOfInformationLink_class(problem,interpretation,element); } | ||
71391 | /** | ||
71392 | * An element must be an instance of type "FunctionalInterface class". | ||
71393 | */ | ||
71394 | private pattern mustInstanceOfFunctionalInterface_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
71395 | Type.name(type,"FunctionalInterface class"); | ||
71396 | find directInstanceOf(problem,interpretation,element,type); | ||
71397 | } | ||
71398 | private pattern scopeDisallowsNewFunctionalInterface_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
71399 | find interpretation(problem,interpretation); | ||
71400 | PartialInterpretation.scopes(interpretation,scope); | ||
71401 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
71402 | Scope.maxNewElements(scope,0); | ||
71403 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
71404 | Type.name(type,"FunctionalInterface class"); | ||
71405 | } | ||
71406 | |||
71407 | /** | ||
71408 | * An element may be an instance of type "FunctionalInterface class". | ||
71409 | */ | ||
71410 | private pattern mayInstanceOfFunctionalInterface_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
71411 | { | ||
71412 | find interpretation(problem,interpretation); | ||
71413 | PartialInterpretation.newElements(interpretation,element); | ||
71414 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
71415 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
71416 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
71417 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
71418 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
71419 | neg find scopeDisallowsNewFunctionalInterface_class(problem, interpretation); | ||
71420 | neg find isPrimitive(element); | ||
71421 | } or { | ||
71422 | find interpretation(problem,interpretation); | ||
71423 | PartialInterpretation.openWorldElements(interpretation,element); | ||
71424 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
71425 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
71426 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
71427 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
71428 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
71429 | neg find scopeDisallowsNewFunctionalInterface_class(problem, interpretation); | ||
71430 | neg find isPrimitive(element); | ||
71431 | } or | ||
71432 | { find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); } | ||
71433 | /** | ||
71434 | * An element must be an instance of type "FunctionalInput class". | ||
71435 | */ | ||
71436 | private pattern mustInstanceOfFunctionalInput_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
71437 | Type.name(type,"FunctionalInput class"); | ||
71438 | find directInstanceOf(problem,interpretation,element,type); | ||
71439 | } | ||
71440 | private pattern scopeDisallowsNewFunctionalInput_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
71441 | find interpretation(problem,interpretation); | ||
71442 | PartialInterpretation.scopes(interpretation,scope); | ||
71443 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
71444 | Scope.maxNewElements(scope,0); | ||
71445 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
71446 | Type.name(type,"FunctionalInput class"); | ||
71447 | } | ||
71448 | |||
71449 | /** | ||
71450 | * An element may be an instance of type "FunctionalInput class". | ||
71451 | */ | ||
71452 | private pattern mayInstanceOfFunctionalInput_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
71453 | { | ||
71454 | find interpretation(problem,interpretation); | ||
71455 | PartialInterpretation.newElements(interpretation,element); | ||
71456 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
71457 | neg find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
71458 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
71459 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
71460 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
71461 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
71462 | neg find scopeDisallowsNewFunctionalInput_class(problem, interpretation); | ||
71463 | neg find isPrimitive(element); | ||
71464 | } or { | ||
71465 | find interpretation(problem,interpretation); | ||
71466 | PartialInterpretation.openWorldElements(interpretation,element); | ||
71467 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
71468 | neg find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
71469 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
71470 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
71471 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
71472 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
71473 | neg find scopeDisallowsNewFunctionalInput_class(problem, interpretation); | ||
71474 | neg find isPrimitive(element); | ||
71475 | } or | ||
71476 | { find mustInstanceOfFunctionalInput_class(problem,interpretation,element); } | ||
71477 | /** | ||
71478 | * An element must be an instance of type "FunctionalOutput class". | ||
71479 | */ | ||
71480 | private pattern mustInstanceOfFunctionalOutput_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
71481 | Type.name(type,"FunctionalOutput class"); | ||
71482 | find directInstanceOf(problem,interpretation,element,type); | ||
71483 | } | ||
71484 | private pattern scopeDisallowsNewFunctionalOutput_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
71485 | find interpretation(problem,interpretation); | ||
71486 | PartialInterpretation.scopes(interpretation,scope); | ||
71487 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
71488 | Scope.maxNewElements(scope,0); | ||
71489 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
71490 | Type.name(type,"FunctionalOutput class"); | ||
71491 | } | ||
71492 | |||
71493 | /** | ||
71494 | * An element may be an instance of type "FunctionalOutput class". | ||
71495 | */ | ||
71496 | private pattern mayInstanceOfFunctionalOutput_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
71497 | { | ||
71498 | find interpretation(problem,interpretation); | ||
71499 | PartialInterpretation.newElements(interpretation,element); | ||
71500 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
71501 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
71502 | neg find mustInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
71503 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
71504 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
71505 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
71506 | neg find scopeDisallowsNewFunctionalOutput_class(problem, interpretation); | ||
71507 | neg find isPrimitive(element); | ||
71508 | } or { | ||
71509 | find interpretation(problem,interpretation); | ||
71510 | PartialInterpretation.openWorldElements(interpretation,element); | ||
71511 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
71512 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
71513 | neg find mustInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
71514 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
71515 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
71516 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
71517 | neg find scopeDisallowsNewFunctionalOutput_class(problem, interpretation); | ||
71518 | neg find isPrimitive(element); | ||
71519 | } or | ||
71520 | { find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); } | ||
71521 | /** | ||
71522 | * An element must be an instance of type "FunctionalData class". | ||
71523 | */ | ||
71524 | private pattern mustInstanceOfFunctionalData_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
71525 | Type.name(type,"FunctionalData class"); | ||
71526 | find directInstanceOf(problem,interpretation,element,type); | ||
71527 | } | ||
71528 | private pattern scopeDisallowsNewFunctionalData_class(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
71529 | find interpretation(problem,interpretation); | ||
71530 | PartialInterpretation.scopes(interpretation,scope); | ||
71531 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
71532 | Scope.maxNewElements(scope,0); | ||
71533 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
71534 | Type.name(type,"FunctionalData class"); | ||
71535 | } | ||
71536 | |||
71537 | /** | ||
71538 | * An element may be an instance of type "FunctionalData class". | ||
71539 | */ | ||
71540 | private pattern mayInstanceOfFunctionalData_class(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
71541 | { | ||
71542 | find interpretation(problem,interpretation); | ||
71543 | PartialInterpretation.newElements(interpretation,element); | ||
71544 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
71545 | neg find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
71546 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
71547 | neg find mustInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
71548 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
71549 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
71550 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
71551 | neg find scopeDisallowsNewFunctionalData_class(problem, interpretation); | ||
71552 | neg find isPrimitive(element); | ||
71553 | } or { | ||
71554 | find interpretation(problem,interpretation); | ||
71555 | PartialInterpretation.openWorldElements(interpretation,element); | ||
71556 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
71557 | neg find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
71558 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
71559 | neg find mustInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
71560 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
71561 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
71562 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
71563 | neg find scopeDisallowsNewFunctionalData_class(problem, interpretation); | ||
71564 | neg find isPrimitive(element); | ||
71565 | } or | ||
71566 | { find mustInstanceOfFunctionalData_class(problem,interpretation,element); } | ||
71567 | /** | ||
71568 | * An element must be an instance of type "FunctionType enum". | ||
71569 | */ | ||
71570 | private pattern mustInstanceOfFunctionType_enum(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) { | ||
71571 | Type.name(type,"FunctionType enum"); | ||
71572 | find directInstanceOf(problem,interpretation,element,type); | ||
71573 | } | ||
71574 | private pattern scopeDisallowsNewFunctionType_enum(problem:LogicProblem, interpretation:PartialInterpretation) { | ||
71575 | find interpretation(problem,interpretation); | ||
71576 | PartialInterpretation.scopes(interpretation,scope); | ||
71577 | Scope.targetTypeInterpretation(scope,typeInterpretation); | ||
71578 | Scope.maxNewElements(scope,0); | ||
71579 | PartialComplexTypeInterpretation.interpretationOf(typeInterpretation,type); | ||
71580 | Type.name(type,"FunctionType enum"); | ||
71581 | } | ||
71582 | |||
71583 | /** | ||
71584 | * An element may be an instance of type "FunctionType enum". | ||
71585 | */ | ||
71586 | private pattern mayInstanceOfFunctionType_enum(problem:LogicProblem, interpretation:PartialInterpretation, element:DefinedElement) | ||
71587 | { find mustInstanceOfFunctionType_enum(problem,interpretation,element); } | ||
71588 | |||
71589 | ////////// | ||
71590 | // 1.2 Relation Declaration Indexers | ||
71591 | ////////// | ||
71592 | /** | ||
71593 | * Matcher for detecting tuples t where []interface reference FunctionalElement(source,target) | ||
71594 | */ | ||
71595 | private pattern mustInRelationinterface_reference_FunctionalElement( | ||
71596 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
71597 | source: DefinedElement, target:DefinedElement) | ||
71598 | { | ||
71599 | find interpretation(problem,interpretation); | ||
71600 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
71601 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"interface reference FunctionalElement"); | ||
71602 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
71603 | BinaryElementRelationLink.param1(link,source); | ||
71604 | BinaryElementRelationLink.param2(link,target); | ||
71605 | } | ||
71606 | /** | ||
71607 | * Matcher for detecting tuples t where <>interface reference FunctionalElement(source,target) | ||
71608 | */ | ||
71609 | private pattern mayInRelationinterface_reference_FunctionalElement( | ||
71610 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
71611 | source: DefinedElement, target:DefinedElement) | ||
71612 | { | ||
71613 | find interpretation(problem,interpretation); | ||
71614 | // The two endpoint of the link have to exist | ||
71615 | find mayExist(problem, interpretation, source); | ||
71616 | find mayExist(problem, interpretation, target); | ||
71617 | // Type consistency | ||
71618 | find mayInstanceOfFunctionalElement_class(problem,interpretation,source); | ||
71619 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,target); | ||
71620 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
71621 | // the upper bound of the multiplicity should be considered. | ||
71622 | numberOfExistingReferences == count find mustInRelationinterface_reference_FunctionalElement(problem,interpretation,source,_); | ||
71623 | check(numberOfExistingReferences < 1); | ||
71624 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
71625 | // the upper bound of the opposite reference multiplicity should be considered. | ||
71626 | numberOfExistingOppositeReferences == count find mustInRelationelement_reference_FunctionalInterface(problem,interpretation,target,_); | ||
71627 | check(numberOfExistingOppositeReferences < 1); | ||
71628 | // The reference is containment, then a new reference cannot be create if: | ||
71629 | // 1. Multiple parents | ||
71630 | neg find mustContains4(problem,interpretation,_,target); | ||
71631 | // 2. Circle in the containment hierarchy | ||
71632 | neg find mustTransitiveContains(source,target); | ||
71633 | } or { | ||
71634 | find mustInRelationinterface_reference_FunctionalElement(problem,interpretation,source,target); | ||
71635 | } | ||
71636 | /** | ||
71637 | * Matcher for detecting tuples t where []model reference FunctionalElement(source,target) | ||
71638 | */ | ||
71639 | private pattern mustInRelationmodel_reference_FunctionalElement( | ||
71640 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
71641 | source: DefinedElement, target:DefinedElement) | ||
71642 | { | ||
71643 | find interpretation(problem,interpretation); | ||
71644 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
71645 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"model reference FunctionalElement"); | ||
71646 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
71647 | BinaryElementRelationLink.param1(link,source); | ||
71648 | BinaryElementRelationLink.param2(link,target); | ||
71649 | } | ||
71650 | /** | ||
71651 | * Matcher for detecting tuples t where <>model reference FunctionalElement(source,target) | ||
71652 | */ | ||
71653 | private pattern mayInRelationmodel_reference_FunctionalElement( | ||
71654 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
71655 | source: DefinedElement, target:DefinedElement) | ||
71656 | { | ||
71657 | find interpretation(problem,interpretation); | ||
71658 | // The two endpoint of the link have to exist | ||
71659 | find mayExist(problem, interpretation, source); | ||
71660 | find mayExist(problem, interpretation, target); | ||
71661 | // Type consistency | ||
71662 | find mayInstanceOfFunctionalElement_class(problem,interpretation,source); | ||
71663 | find mayInstanceOfFunctionalArchitectureModel_class(problem,interpretation,target); | ||
71664 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
71665 | // the upper bound of the multiplicity should be considered. | ||
71666 | numberOfExistingReferences == count find mustInRelationmodel_reference_FunctionalElement(problem,interpretation,source,_); | ||
71667 | check(numberOfExistingReferences < 1); | ||
71668 | } or { | ||
71669 | find mustInRelationmodel_reference_FunctionalElement(problem,interpretation,source,target); | ||
71670 | } | ||
71671 | /** | ||
71672 | * Matcher for detecting tuples t where []parent reference FunctionalElement(source,target) | ||
71673 | */ | ||
71674 | private pattern mustInRelationparent_reference_FunctionalElement( | ||
71675 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
71676 | source: DefinedElement, target:DefinedElement) | ||
71677 | { | ||
71678 | find interpretation(problem,interpretation); | ||
71679 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
71680 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"parent reference FunctionalElement"); | ||
71681 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
71682 | BinaryElementRelationLink.param1(link,source); | ||
71683 | BinaryElementRelationLink.param2(link,target); | ||
71684 | } | ||
71685 | /** | ||
71686 | * Matcher for detecting tuples t where <>parent reference FunctionalElement(source,target) | ||
71687 | */ | ||
71688 | private pattern mayInRelationparent_reference_FunctionalElement( | ||
71689 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
71690 | source: DefinedElement, target:DefinedElement) | ||
71691 | { | ||
71692 | find interpretation(problem,interpretation); | ||
71693 | // The two endpoint of the link have to exist | ||
71694 | find mayExist(problem, interpretation, source); | ||
71695 | find mayExist(problem, interpretation, target); | ||
71696 | // Type consistency | ||
71697 | find mayInstanceOfFunctionalElement_class(problem,interpretation,source); | ||
71698 | find mayInstanceOfFunction_class(problem,interpretation,target); | ||
71699 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
71700 | // the upper bound of the multiplicity should be considered. | ||
71701 | numberOfExistingReferences == count find mustInRelationparent_reference_FunctionalElement(problem,interpretation,source,_); | ||
71702 | check(numberOfExistingReferences < 1); | ||
71703 | // The eOpposite of the reference is containment, then a referene cannot be created if | ||
71704 | // 1. Multiple parents | ||
71705 | neg find mustContains4(problem,interpretation,source,_); | ||
71706 | // 2. Circle in the containment hierarchy | ||
71707 | neg find mustTransitiveContains(source,target); | ||
71708 | } or { | ||
71709 | find mustInRelationparent_reference_FunctionalElement(problem,interpretation,source,target); | ||
71710 | } | ||
71711 | /** | ||
71712 | * Matcher for detecting tuples t where []rootElements reference FunctionalArchitectureModel(source,target) | ||
71713 | */ | ||
71714 | private pattern mustInRelationrootElements_reference_FunctionalArchitectureModel( | ||
71715 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
71716 | source: DefinedElement, target:DefinedElement) | ||
71717 | { | ||
71718 | find interpretation(problem,interpretation); | ||
71719 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
71720 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"rootElements reference FunctionalArchitectureModel"); | ||
71721 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
71722 | BinaryElementRelationLink.param1(link,source); | ||
71723 | BinaryElementRelationLink.param2(link,target); | ||
71724 | } | ||
71725 | /** | ||
71726 | * Matcher for detecting tuples t where <>rootElements reference FunctionalArchitectureModel(source,target) | ||
71727 | */ | ||
71728 | private pattern mayInRelationrootElements_reference_FunctionalArchitectureModel( | ||
71729 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
71730 | source: DefinedElement, target:DefinedElement) | ||
71731 | { | ||
71732 | find interpretation(problem,interpretation); | ||
71733 | // The two endpoint of the link have to exist | ||
71734 | find mayExist(problem, interpretation, source); | ||
71735 | find mayExist(problem, interpretation, target); | ||
71736 | // Type consistency | ||
71737 | find mayInstanceOfFunctionalArchitectureModel_class(problem,interpretation,source); | ||
71738 | find mayInstanceOfFunctionalElement_class(problem,interpretation,target); | ||
71739 | // The reference is containment, then a new reference cannot be create if: | ||
71740 | // 1. Multiple parents | ||
71741 | neg find mustContains4(problem,interpretation,_,target); | ||
71742 | // 2. Circle in the containment hierarchy | ||
71743 | neg find mustTransitiveContains(source,target); | ||
71744 | } or { | ||
71745 | find mustInRelationrootElements_reference_FunctionalArchitectureModel(problem,interpretation,source,target); | ||
71746 | } | ||
71747 | /** | ||
71748 | * Matcher for detecting tuples t where []subElements reference Function(source,target) | ||
71749 | */ | ||
71750 | private pattern mustInRelationsubElements_reference_Function( | ||
71751 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
71752 | source: DefinedElement, target:DefinedElement) | ||
71753 | { | ||
71754 | find interpretation(problem,interpretation); | ||
71755 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
71756 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"subElements reference Function"); | ||
71757 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
71758 | BinaryElementRelationLink.param1(link,source); | ||
71759 | BinaryElementRelationLink.param2(link,target); | ||
71760 | } | ||
71761 | /** | ||
71762 | * Matcher for detecting tuples t where <>subElements reference Function(source,target) | ||
71763 | */ | ||
71764 | private pattern mayInRelationsubElements_reference_Function( | ||
71765 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
71766 | source: DefinedElement, target:DefinedElement) | ||
71767 | { | ||
71768 | find interpretation(problem,interpretation); | ||
71769 | // The two endpoint of the link have to exist | ||
71770 | find mayExist(problem, interpretation, source); | ||
71771 | find mayExist(problem, interpretation, target); | ||
71772 | // Type consistency | ||
71773 | find mayInstanceOfFunction_class(problem,interpretation,source); | ||
71774 | find mayInstanceOfFunctionalElement_class(problem,interpretation,target); | ||
71775 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
71776 | // the upper bound of the opposite reference multiplicity should be considered. | ||
71777 | numberOfExistingOppositeReferences == count find mustInRelationparent_reference_FunctionalElement(problem,interpretation,target,_); | ||
71778 | check(numberOfExistingOppositeReferences < 1); | ||
71779 | // The reference is containment, then a new reference cannot be create if: | ||
71780 | // 1. Multiple parents | ||
71781 | neg find mustContains4(problem,interpretation,_,target); | ||
71782 | // 2. Circle in the containment hierarchy | ||
71783 | neg find mustTransitiveContains(source,target); | ||
71784 | } or { | ||
71785 | find mustInRelationsubElements_reference_Function(problem,interpretation,source,target); | ||
71786 | } | ||
71787 | /** | ||
71788 | * Matcher for detecting tuples t where []data reference FAMTerminator(source,target) | ||
71789 | */ | ||
71790 | private pattern mustInRelationdata_reference_FAMTerminator( | ||
71791 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
71792 | source: DefinedElement, target:DefinedElement) | ||
71793 | { | ||
71794 | find interpretation(problem,interpretation); | ||
71795 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
71796 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"data reference FAMTerminator"); | ||
71797 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
71798 | BinaryElementRelationLink.param1(link,source); | ||
71799 | BinaryElementRelationLink.param2(link,target); | ||
71800 | } | ||
71801 | /** | ||
71802 | * Matcher for detecting tuples t where <>data reference FAMTerminator(source,target) | ||
71803 | */ | ||
71804 | private pattern mayInRelationdata_reference_FAMTerminator( | ||
71805 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
71806 | source: DefinedElement, target:DefinedElement) | ||
71807 | { | ||
71808 | find interpretation(problem,interpretation); | ||
71809 | // The two endpoint of the link have to exist | ||
71810 | find mayExist(problem, interpretation, source); | ||
71811 | find mayExist(problem, interpretation, target); | ||
71812 | // Type consistency | ||
71813 | find mayInstanceOfFAMTerminator_class(problem,interpretation,source); | ||
71814 | find mayInstanceOfFunctionalData_class(problem,interpretation,target); | ||
71815 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
71816 | // the upper bound of the multiplicity should be considered. | ||
71817 | numberOfExistingReferences == count find mustInRelationdata_reference_FAMTerminator(problem,interpretation,source,_); | ||
71818 | check(numberOfExistingReferences < 1); | ||
71819 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
71820 | // the upper bound of the opposite reference multiplicity should be considered. | ||
71821 | numberOfExistingOppositeReferences == count find mustInRelationterminator_reference_FunctionalData(problem,interpretation,target,_); | ||
71822 | check(numberOfExistingOppositeReferences < 1); | ||
71823 | // The eOpposite of the reference is containment, then a referene cannot be created if | ||
71824 | // 1. Multiple parents | ||
71825 | neg find mustContains4(problem,interpretation,source,_); | ||
71826 | // 2. Circle in the containment hierarchy | ||
71827 | neg find mustTransitiveContains(source,target); | ||
71828 | } or { | ||
71829 | find mustInRelationdata_reference_FAMTerminator(problem,interpretation,source,target); | ||
71830 | } | ||
71831 | /** | ||
71832 | * Matcher for detecting tuples t where []from reference InformationLink(source,target) | ||
71833 | */ | ||
71834 | private pattern mustInRelationfrom_reference_InformationLink( | ||
71835 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
71836 | source: DefinedElement, target:DefinedElement) | ||
71837 | { | ||
71838 | find interpretation(problem,interpretation); | ||
71839 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
71840 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"from reference InformationLink"); | ||
71841 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
71842 | BinaryElementRelationLink.param1(link,source); | ||
71843 | BinaryElementRelationLink.param2(link,target); | ||
71844 | } | ||
71845 | /** | ||
71846 | * Matcher for detecting tuples t where <>from reference InformationLink(source,target) | ||
71847 | */ | ||
71848 | private pattern mayInRelationfrom_reference_InformationLink( | ||
71849 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
71850 | source: DefinedElement, target:DefinedElement) | ||
71851 | { | ||
71852 | find interpretation(problem,interpretation); | ||
71853 | // The two endpoint of the link have to exist | ||
71854 | find mayExist(problem, interpretation, source); | ||
71855 | find mayExist(problem, interpretation, target); | ||
71856 | // Type consistency | ||
71857 | find mayInstanceOfInformationLink_class(problem,interpretation,source); | ||
71858 | find mayInstanceOfFunctionalOutput_class(problem,interpretation,target); | ||
71859 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
71860 | // the upper bound of the multiplicity should be considered. | ||
71861 | numberOfExistingReferences == count find mustInRelationfrom_reference_InformationLink(problem,interpretation,source,_); | ||
71862 | check(numberOfExistingReferences < 1); | ||
71863 | // The eOpposite of the reference is containment, then a referene cannot be created if | ||
71864 | // 1. Multiple parents | ||
71865 | neg find mustContains4(problem,interpretation,source,_); | ||
71866 | // 2. Circle in the containment hierarchy | ||
71867 | neg find mustTransitiveContains(source,target); | ||
71868 | } or { | ||
71869 | find mustInRelationfrom_reference_InformationLink(problem,interpretation,source,target); | ||
71870 | } | ||
71871 | /** | ||
71872 | * Matcher for detecting tuples t where []to reference InformationLink(source,target) | ||
71873 | */ | ||
71874 | private pattern mustInRelationto_reference_InformationLink( | ||
71875 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
71876 | source: DefinedElement, target:DefinedElement) | ||
71877 | { | ||
71878 | find interpretation(problem,interpretation); | ||
71879 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
71880 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"to reference InformationLink"); | ||
71881 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
71882 | BinaryElementRelationLink.param1(link,source); | ||
71883 | BinaryElementRelationLink.param2(link,target); | ||
71884 | } | ||
71885 | /** | ||
71886 | * Matcher for detecting tuples t where <>to reference InformationLink(source,target) | ||
71887 | */ | ||
71888 | private pattern mayInRelationto_reference_InformationLink( | ||
71889 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
71890 | source: DefinedElement, target:DefinedElement) | ||
71891 | { | ||
71892 | find interpretation(problem,interpretation); | ||
71893 | // The two endpoint of the link have to exist | ||
71894 | find mayExist(problem, interpretation, source); | ||
71895 | find mayExist(problem, interpretation, target); | ||
71896 | // Type consistency | ||
71897 | find mayInstanceOfInformationLink_class(problem,interpretation,source); | ||
71898 | find mayInstanceOfFunctionalInput_class(problem,interpretation,target); | ||
71899 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
71900 | // the upper bound of the multiplicity should be considered. | ||
71901 | numberOfExistingReferences == count find mustInRelationto_reference_InformationLink(problem,interpretation,source,_); | ||
71902 | check(numberOfExistingReferences < 1); | ||
71903 | } or { | ||
71904 | find mustInRelationto_reference_InformationLink(problem,interpretation,source,target); | ||
71905 | } | ||
71906 | /** | ||
71907 | * Matcher for detecting tuples t where []data reference FunctionalInterface(source,target) | ||
71908 | */ | ||
71909 | private pattern mustInRelationdata_reference_FunctionalInterface( | ||
71910 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
71911 | source: DefinedElement, target:DefinedElement) | ||
71912 | { | ||
71913 | find interpretation(problem,interpretation); | ||
71914 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
71915 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"data reference FunctionalInterface"); | ||
71916 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
71917 | BinaryElementRelationLink.param1(link,source); | ||
71918 | BinaryElementRelationLink.param2(link,target); | ||
71919 | } | ||
71920 | /** | ||
71921 | * Matcher for detecting tuples t where <>data reference FunctionalInterface(source,target) | ||
71922 | */ | ||
71923 | private pattern mayInRelationdata_reference_FunctionalInterface( | ||
71924 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
71925 | source: DefinedElement, target:DefinedElement) | ||
71926 | { | ||
71927 | find interpretation(problem,interpretation); | ||
71928 | // The two endpoint of the link have to exist | ||
71929 | find mayExist(problem, interpretation, source); | ||
71930 | find mayExist(problem, interpretation, target); | ||
71931 | // Type consistency | ||
71932 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,source); | ||
71933 | find mayInstanceOfFunctionalData_class(problem,interpretation,target); | ||
71934 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
71935 | // the upper bound of the opposite reference multiplicity should be considered. | ||
71936 | numberOfExistingOppositeReferences == count find mustInRelationinterface_reference_FunctionalData(problem,interpretation,target,_); | ||
71937 | check(numberOfExistingOppositeReferences < 1); | ||
71938 | // The reference is containment, then a new reference cannot be create if: | ||
71939 | // 1. Multiple parents | ||
71940 | neg find mustContains4(problem,interpretation,_,target); | ||
71941 | // 2. Circle in the containment hierarchy | ||
71942 | neg find mustTransitiveContains(source,target); | ||
71943 | } or { | ||
71944 | find mustInRelationdata_reference_FunctionalInterface(problem,interpretation,source,target); | ||
71945 | } | ||
71946 | /** | ||
71947 | * Matcher for detecting tuples t where []element reference FunctionalInterface(source,target) | ||
71948 | */ | ||
71949 | private pattern mustInRelationelement_reference_FunctionalInterface( | ||
71950 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
71951 | source: DefinedElement, target:DefinedElement) | ||
71952 | { | ||
71953 | find interpretation(problem,interpretation); | ||
71954 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
71955 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"element reference FunctionalInterface"); | ||
71956 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
71957 | BinaryElementRelationLink.param1(link,source); | ||
71958 | BinaryElementRelationLink.param2(link,target); | ||
71959 | } | ||
71960 | /** | ||
71961 | * Matcher for detecting tuples t where <>element reference FunctionalInterface(source,target) | ||
71962 | */ | ||
71963 | private pattern mayInRelationelement_reference_FunctionalInterface( | ||
71964 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
71965 | source: DefinedElement, target:DefinedElement) | ||
71966 | { | ||
71967 | find interpretation(problem,interpretation); | ||
71968 | // The two endpoint of the link have to exist | ||
71969 | find mayExist(problem, interpretation, source); | ||
71970 | find mayExist(problem, interpretation, target); | ||
71971 | // Type consistency | ||
71972 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,source); | ||
71973 | find mayInstanceOfFunctionalElement_class(problem,interpretation,target); | ||
71974 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
71975 | // the upper bound of the multiplicity should be considered. | ||
71976 | numberOfExistingReferences == count find mustInRelationelement_reference_FunctionalInterface(problem,interpretation,source,_); | ||
71977 | check(numberOfExistingReferences < 1); | ||
71978 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
71979 | // the upper bound of the opposite reference multiplicity should be considered. | ||
71980 | numberOfExistingOppositeReferences == count find mustInRelationinterface_reference_FunctionalElement(problem,interpretation,target,_); | ||
71981 | check(numberOfExistingOppositeReferences < 1); | ||
71982 | // The eOpposite of the reference is containment, then a referene cannot be created if | ||
71983 | // 1. Multiple parents | ||
71984 | neg find mustContains4(problem,interpretation,source,_); | ||
71985 | // 2. Circle in the containment hierarchy | ||
71986 | neg find mustTransitiveContains(source,target); | ||
71987 | } or { | ||
71988 | find mustInRelationelement_reference_FunctionalInterface(problem,interpretation,source,target); | ||
71989 | } | ||
71990 | /** | ||
71991 | * Matcher for detecting tuples t where []IncomingLinks reference FunctionalInput(source,target) | ||
71992 | */ | ||
71993 | private pattern mustInRelationIncomingLinks_reference_FunctionalInput( | ||
71994 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
71995 | source: DefinedElement, target:DefinedElement) | ||
71996 | { | ||
71997 | find interpretation(problem,interpretation); | ||
71998 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
71999 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"IncomingLinks reference FunctionalInput"); | ||
72000 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
72001 | BinaryElementRelationLink.param1(link,source); | ||
72002 | BinaryElementRelationLink.param2(link,target); | ||
72003 | } | ||
72004 | /** | ||
72005 | * Matcher for detecting tuples t where <>IncomingLinks reference FunctionalInput(source,target) | ||
72006 | */ | ||
72007 | private pattern mayInRelationIncomingLinks_reference_FunctionalInput( | ||
72008 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
72009 | source: DefinedElement, target:DefinedElement) | ||
72010 | { | ||
72011 | find interpretation(problem,interpretation); | ||
72012 | // The two endpoint of the link have to exist | ||
72013 | find mayExist(problem, interpretation, source); | ||
72014 | find mayExist(problem, interpretation, target); | ||
72015 | // Type consistency | ||
72016 | find mayInstanceOfFunctionalInput_class(problem,interpretation,source); | ||
72017 | find mayInstanceOfInformationLink_class(problem,interpretation,target); | ||
72018 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
72019 | // the upper bound of the opposite reference multiplicity should be considered. | ||
72020 | numberOfExistingOppositeReferences == count find mustInRelationto_reference_InformationLink(problem,interpretation,target,_); | ||
72021 | check(numberOfExistingOppositeReferences < 1); | ||
72022 | } or { | ||
72023 | find mustInRelationIncomingLinks_reference_FunctionalInput(problem,interpretation,source,target); | ||
72024 | } | ||
72025 | /** | ||
72026 | * Matcher for detecting tuples t where []outgoingLinks reference FunctionalOutput(source,target) | ||
72027 | */ | ||
72028 | private pattern mustInRelationoutgoingLinks_reference_FunctionalOutput( | ||
72029 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
72030 | source: DefinedElement, target:DefinedElement) | ||
72031 | { | ||
72032 | find interpretation(problem,interpretation); | ||
72033 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
72034 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"outgoingLinks reference FunctionalOutput"); | ||
72035 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
72036 | BinaryElementRelationLink.param1(link,source); | ||
72037 | BinaryElementRelationLink.param2(link,target); | ||
72038 | } | ||
72039 | /** | ||
72040 | * Matcher for detecting tuples t where <>outgoingLinks reference FunctionalOutput(source,target) | ||
72041 | */ | ||
72042 | private pattern mayInRelationoutgoingLinks_reference_FunctionalOutput( | ||
72043 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
72044 | source: DefinedElement, target:DefinedElement) | ||
72045 | { | ||
72046 | find interpretation(problem,interpretation); | ||
72047 | // The two endpoint of the link have to exist | ||
72048 | find mayExist(problem, interpretation, source); | ||
72049 | find mayExist(problem, interpretation, target); | ||
72050 | // Type consistency | ||
72051 | find mayInstanceOfFunctionalOutput_class(problem,interpretation,source); | ||
72052 | find mayInstanceOfInformationLink_class(problem,interpretation,target); | ||
72053 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
72054 | // the upper bound of the opposite reference multiplicity should be considered. | ||
72055 | numberOfExistingOppositeReferences == count find mustInRelationfrom_reference_InformationLink(problem,interpretation,target,_); | ||
72056 | check(numberOfExistingOppositeReferences < 1); | ||
72057 | // The reference is containment, then a new reference cannot be create if: | ||
72058 | // 1. Multiple parents | ||
72059 | neg find mustContains4(problem,interpretation,_,target); | ||
72060 | // 2. Circle in the containment hierarchy | ||
72061 | neg find mustTransitiveContains(source,target); | ||
72062 | } or { | ||
72063 | find mustInRelationoutgoingLinks_reference_FunctionalOutput(problem,interpretation,source,target); | ||
72064 | } | ||
72065 | /** | ||
72066 | * Matcher for detecting tuples t where []terminator reference FunctionalData(source,target) | ||
72067 | */ | ||
72068 | private pattern mustInRelationterminator_reference_FunctionalData( | ||
72069 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
72070 | source: DefinedElement, target:DefinedElement) | ||
72071 | { | ||
72072 | find interpretation(problem,interpretation); | ||
72073 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
72074 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"terminator reference FunctionalData"); | ||
72075 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
72076 | BinaryElementRelationLink.param1(link,source); | ||
72077 | BinaryElementRelationLink.param2(link,target); | ||
72078 | } | ||
72079 | /** | ||
72080 | * Matcher for detecting tuples t where <>terminator reference FunctionalData(source,target) | ||
72081 | */ | ||
72082 | private pattern mayInRelationterminator_reference_FunctionalData( | ||
72083 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
72084 | source: DefinedElement, target:DefinedElement) | ||
72085 | { | ||
72086 | find interpretation(problem,interpretation); | ||
72087 | // The two endpoint of the link have to exist | ||
72088 | find mayExist(problem, interpretation, source); | ||
72089 | find mayExist(problem, interpretation, target); | ||
72090 | // Type consistency | ||
72091 | find mayInstanceOfFunctionalData_class(problem,interpretation,source); | ||
72092 | find mayInstanceOfFAMTerminator_class(problem,interpretation,target); | ||
72093 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
72094 | // the upper bound of the multiplicity should be considered. | ||
72095 | numberOfExistingReferences == count find mustInRelationterminator_reference_FunctionalData(problem,interpretation,source,_); | ||
72096 | check(numberOfExistingReferences < 1); | ||
72097 | // There are "numberOfExistingReferences" currently existing instances of the reference to the target, | ||
72098 | // the upper bound of the opposite reference multiplicity should be considered. | ||
72099 | numberOfExistingOppositeReferences == count find mustInRelationdata_reference_FAMTerminator(problem,interpretation,target,_); | ||
72100 | check(numberOfExistingOppositeReferences < 1); | ||
72101 | // The reference is containment, then a new reference cannot be create if: | ||
72102 | // 1. Multiple parents | ||
72103 | neg find mustContains4(problem,interpretation,_,target); | ||
72104 | // 2. Circle in the containment hierarchy | ||
72105 | neg find mustTransitiveContains(source,target); | ||
72106 | } or { | ||
72107 | find mustInRelationterminator_reference_FunctionalData(problem,interpretation,source,target); | ||
72108 | } | ||
72109 | /** | ||
72110 | * Matcher for detecting tuples t where []interface reference FunctionalData(source,target) | ||
72111 | */ | ||
72112 | private pattern mustInRelationinterface_reference_FunctionalData( | ||
72113 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
72114 | source: DefinedElement, target:DefinedElement) | ||
72115 | { | ||
72116 | find interpretation(problem,interpretation); | ||
72117 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
72118 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"interface reference FunctionalData"); | ||
72119 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
72120 | BinaryElementRelationLink.param1(link,source); | ||
72121 | BinaryElementRelationLink.param2(link,target); | ||
72122 | } | ||
72123 | /** | ||
72124 | * Matcher for detecting tuples t where <>interface reference FunctionalData(source,target) | ||
72125 | */ | ||
72126 | private pattern mayInRelationinterface_reference_FunctionalData( | ||
72127 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
72128 | source: DefinedElement, target:DefinedElement) | ||
72129 | { | ||
72130 | find interpretation(problem,interpretation); | ||
72131 | // The two endpoint of the link have to exist | ||
72132 | find mayExist(problem, interpretation, source); | ||
72133 | find mayExist(problem, interpretation, target); | ||
72134 | // Type consistency | ||
72135 | find mayInstanceOfFunctionalData_class(problem,interpretation,source); | ||
72136 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,target); | ||
72137 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
72138 | // the upper bound of the multiplicity should be considered. | ||
72139 | numberOfExistingReferences == count find mustInRelationinterface_reference_FunctionalData(problem,interpretation,source,_); | ||
72140 | check(numberOfExistingReferences < 1); | ||
72141 | // The eOpposite of the reference is containment, then a referene cannot be created if | ||
72142 | // 1. Multiple parents | ||
72143 | neg find mustContains4(problem,interpretation,source,_); | ||
72144 | // 2. Circle in the containment hierarchy | ||
72145 | neg find mustTransitiveContains(source,target); | ||
72146 | } or { | ||
72147 | find mustInRelationinterface_reference_FunctionalData(problem,interpretation,source,target); | ||
72148 | } | ||
72149 | /** | ||
72150 | * Matcher for detecting tuples t where []type attribute Function(source,target) | ||
72151 | */ | ||
72152 | private pattern mustInRelationtype_attribute_Function( | ||
72153 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
72154 | source: DefinedElement, target:DefinedElement) | ||
72155 | { | ||
72156 | find interpretation(problem,interpretation); | ||
72157 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
72158 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"type attribute Function"); | ||
72159 | PartialRelationInterpretation.relationlinks(relationIterpretation,link); | ||
72160 | BinaryElementRelationLink.param1(link,source); | ||
72161 | BinaryElementRelationLink.param2(link,target); | ||
72162 | } | ||
72163 | /** | ||
72164 | * Matcher for detecting tuples t where <>type attribute Function(source,target) | ||
72165 | */ | ||
72166 | private pattern mayInRelationtype_attribute_Function( | ||
72167 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
72168 | source: DefinedElement, target:DefinedElement) | ||
72169 | { | ||
72170 | find interpretation(problem,interpretation); | ||
72171 | // The two endpoint of the link have to exist | ||
72172 | find mayExist(problem, interpretation, source); | ||
72173 | find mayExist(problem, interpretation, target); | ||
72174 | // Type consistency | ||
72175 | find mayInstanceOfFunction_class(problem,interpretation,source); | ||
72176 | find mayInstanceOfFunctionType_enum(problem,interpretation,target); | ||
72177 | // There are "numberOfExistingReferences" currently existing instances of the reference from the source, | ||
72178 | // the upper bound of the multiplicity should be considered. | ||
72179 | numberOfExistingReferences == count find mustInRelationtype_attribute_Function(problem,interpretation,source,_); | ||
72180 | check(numberOfExistingReferences < 1); | ||
72181 | } or { | ||
72182 | find mustInRelationtype_attribute_Function(problem,interpretation,source,target); | ||
72183 | } | ||
72184 | |||
72185 | ////////// | ||
72186 | // 1.3 Relation Definition Indexers | ||
72187 | ////////// | ||
72188 | |||
72189 | ////////// | ||
72190 | // 1.4 Containment Indexer | ||
72191 | ////////// | ||
72192 | private pattern mustContains2(source: DefinedElement, target: DefinedElement) { | ||
72193 | find mustContains4(_,_,source,target); | ||
72194 | } | ||
72195 | |||
72196 | private pattern mustContains4(problem:LogicProblem, interpretation:PartialInterpretation, | ||
72197 | source: DefinedElement, target: DefinedElement) | ||
72198 | { find mustInRelationinterface_reference_FunctionalElement(problem,interpretation,source,target); }or | ||
72199 | |||
72200 | { find mustInRelationrootElements_reference_FunctionalArchitectureModel(problem,interpretation,source,target); }or | ||
72201 | |||
72202 | { find mustInRelationsubElements_reference_Function(problem,interpretation,source,target); }or | ||
72203 | |||
72204 | { find mustInRelationdata_reference_FunctionalInterface(problem,interpretation,source,target); }or | ||
72205 | |||
72206 | { find mustInRelationoutgoingLinks_reference_FunctionalOutput(problem,interpretation,source,target); }or | ||
72207 | |||
72208 | { find mustInRelationterminator_reference_FunctionalData(problem,interpretation,source,target); } | ||
72209 | |||
72210 | private pattern mustTransitiveContains(source,target) { | ||
72211 | find mustContains2+(source,target); | ||
72212 | } | ||
72213 | |||
72214 | ////////// | ||
72215 | // 2. Invalidation Indexers | ||
72216 | ////////// | ||
72217 | // 2.1 Invalidated by WF Queries | ||
72218 | ////////// | ||
72219 | |||
72220 | ////////// | ||
72221 | // 3. Unfinishedness Indexers | ||
72222 | ////////// | ||
72223 | // 3.1 Unfinishedness Measured by Multiplicity | ||
72224 | ////////// | ||
72225 | pattern unfinishedLowerMultiplicity_model_reference_FunctionalElement(problem:LogicProblem, interpretation:PartialInterpretation, relationIterpretation:PartialRelationInterpretation, object:DefinedElement,missingMultiplicity) { | ||
72226 | find interpretation(problem,interpretation); | ||
72227 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
72228 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"model reference FunctionalElement"); | ||
72229 | find mustInstanceOfFunctionalElement_class(problem,interpretation,object); | ||
72230 | numberOfExistingReferences == count find mustInRelationmodel_reference_FunctionalElement(problem,interpretation,object,_); | ||
72231 | check(numberOfExistingReferences < 1); | ||
72232 | missingMultiplicity == eval(1-numberOfExistingReferences); | ||
72233 | } | ||
72234 | pattern unfinishedLowerMultiplicity_to_reference_InformationLink(problem:LogicProblem, interpretation:PartialInterpretation, relationIterpretation:PartialRelationInterpretation, object:DefinedElement,missingMultiplicity) { | ||
72235 | find interpretation(problem,interpretation); | ||
72236 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
72237 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"to reference InformationLink"); | ||
72238 | find mustInstanceOfInformationLink_class(problem,interpretation,object); | ||
72239 | numberOfExistingReferences == count find mustInRelationto_reference_InformationLink(problem,interpretation,object,_); | ||
72240 | check(numberOfExistingReferences < 1); | ||
72241 | missingMultiplicity == eval(1-numberOfExistingReferences); | ||
72242 | } | ||
72243 | pattern unfinishedLowerMultiplicity_type_attribute_Function(problem:LogicProblem, interpretation:PartialInterpretation, relationIterpretation:PartialRelationInterpretation, object:DefinedElement,missingMultiplicity) { | ||
72244 | find interpretation(problem,interpretation); | ||
72245 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
72246 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"type attribute Function"); | ||
72247 | find mustInstanceOfFunction_class(problem,interpretation,object); | ||
72248 | numberOfExistingReferences == count find mustInRelationtype_attribute_Function(problem,interpretation,object,_); | ||
72249 | check(numberOfExistingReferences < 1); | ||
72250 | missingMultiplicity == eval(1-numberOfExistingReferences); | ||
72251 | } | ||
72252 | |||
72253 | ////////// | ||
72254 | // 3.2 Unfinishedness Measured by WF Queries | ||
72255 | ////////// | ||
72256 | |||
72257 | ////////// | ||
72258 | // 4. Refinement Indexers | ||
72259 | ////////// | ||
72260 | // 4.1 Object constructors | ||
72261 | ////////// | ||
72262 | private pattern hasElementInContainment(problem:LogicProblem, interpretation:PartialInterpretation) | ||
72263 | { | ||
72264 | find interpretation(problem,interpretation); | ||
72265 | find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,root); | ||
72266 | find mustExist(problem, interpretation, root); | ||
72267 | }or{ | ||
72268 | find interpretation(problem,interpretation); | ||
72269 | find mustInstanceOfFunctionalInput_class(problem,interpretation,root); | ||
72270 | find mustExist(problem, interpretation, root); | ||
72271 | }or{ | ||
72272 | find interpretation(problem,interpretation); | ||
72273 | find mustInstanceOfFunctionalOutput_class(problem,interpretation,root); | ||
72274 | find mustExist(problem, interpretation, root); | ||
72275 | }or{ | ||
72276 | find interpretation(problem,interpretation); | ||
72277 | find mustInstanceOfFAMTerminator_class(problem,interpretation,root); | ||
72278 | find mustExist(problem, interpretation, root); | ||
72279 | }or{ | ||
72280 | find interpretation(problem,interpretation); | ||
72281 | find mustInstanceOfFunctionalInterface_class(problem,interpretation,root); | ||
72282 | find mustExist(problem, interpretation, root); | ||
72283 | }or{ | ||
72284 | find interpretation(problem,interpretation); | ||
72285 | find mustInstanceOfFunction_class(problem,interpretation,root); | ||
72286 | find mustExist(problem, interpretation, root); | ||
72287 | }or{ | ||
72288 | find interpretation(problem,interpretation); | ||
72289 | find mustInstanceOfInformationLink_class(problem,interpretation,root); | ||
72290 | find mustExist(problem, interpretation, root); | ||
72291 | }or{ | ||
72292 | find interpretation(problem,interpretation); | ||
72293 | find mustInstanceOfFunctionalElement_class(problem,interpretation,root); | ||
72294 | find mustExist(problem, interpretation, root); | ||
72295 | }or{ | ||
72296 | find interpretation(problem,interpretation); | ||
72297 | find mustInstanceOfFunctionalData_class(problem,interpretation,root); | ||
72298 | find mustExist(problem, interpretation, root); | ||
72299 | } | ||
72300 | pattern createObject_FunctionalInterface_class_by_interface_reference_FunctionalElement_with_element_reference_FunctionalInterface( | ||
72301 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
72302 | relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
72303 | container:DefinedElement) | ||
72304 | { | ||
72305 | find interpretation(problem,interpretation); | ||
72306 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
72307 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalInterface class"); | ||
72308 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
72309 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"interface reference FunctionalElement"); | ||
72310 | PartialInterpretation.partialrelationinterpretation(interpretation,inverseInterpretation); | ||
72311 | PartialRelationInterpretation.interpretationOf.name(inverseInterpretation,"element reference FunctionalInterface"); | ||
72312 | find mustInstanceOfFunctionalElement_class(problem,interpretation,container); | ||
72313 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,newObject); | ||
72314 | find mayInRelationinterface_reference_FunctionalElement(problem,interpretation,container,newObject); | ||
72315 | find mustExist(problem, interpretation, container); | ||
72316 | neg find mustExist(problem, interpretation, newObject); | ||
72317 | } | ||
72318 | pattern createObject_FunctionalInterface_class( | ||
72319 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
72320 | typeInterpretation:PartialComplexTypeInterpretation) | ||
72321 | { | ||
72322 | find interpretation(problem,interpretation); | ||
72323 | neg find hasElementInContainment(problem,interpretation); | ||
72324 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
72325 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalInterface class"); | ||
72326 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,newObject); | ||
72327 | find mayExist(problem, interpretation, newObject); | ||
72328 | neg find mustExist(problem, interpretation, newObject); | ||
72329 | } | ||
72330 | pattern createObject_Function_class_by_rootElements_reference_FunctionalArchitectureModel( | ||
72331 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
72332 | relationInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
72333 | container:DefinedElement) | ||
72334 | { | ||
72335 | find interpretation(problem,interpretation); | ||
72336 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
72337 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"Function class"); | ||
72338 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
72339 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"rootElements reference FunctionalArchitectureModel"); | ||
72340 | find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,container); | ||
72341 | find mayInstanceOfFunction_class(problem,interpretation,newObject); | ||
72342 | find mayInRelationrootElements_reference_FunctionalArchitectureModel(problem,interpretation,container,newObject); | ||
72343 | find mustExist(problem, interpretation, container); | ||
72344 | neg find mustExist(problem, interpretation, newObject); | ||
72345 | } | ||
72346 | pattern createObject_Function_class_by_subElements_reference_Function_with_parent_reference_FunctionalElement( | ||
72347 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
72348 | relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
72349 | container:DefinedElement) | ||
72350 | { | ||
72351 | find interpretation(problem,interpretation); | ||
72352 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
72353 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"Function class"); | ||
72354 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
72355 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"subElements reference Function"); | ||
72356 | PartialInterpretation.partialrelationinterpretation(interpretation,inverseInterpretation); | ||
72357 | PartialRelationInterpretation.interpretationOf.name(inverseInterpretation,"parent reference FunctionalElement"); | ||
72358 | find mustInstanceOfFunction_class(problem,interpretation,container); | ||
72359 | find mayInstanceOfFunction_class(problem,interpretation,newObject); | ||
72360 | find mayInRelationsubElements_reference_Function(problem,interpretation,container,newObject); | ||
72361 | find mustExist(problem, interpretation, container); | ||
72362 | neg find mustExist(problem, interpretation, newObject); | ||
72363 | } | ||
72364 | pattern createObject_Function_class( | ||
72365 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
72366 | typeInterpretation:PartialComplexTypeInterpretation) | ||
72367 | { | ||
72368 | find interpretation(problem,interpretation); | ||
72369 | neg find hasElementInContainment(problem,interpretation); | ||
72370 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
72371 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"Function class"); | ||
72372 | find mayInstanceOfFunction_class(problem,interpretation,newObject); | ||
72373 | find mayExist(problem, interpretation, newObject); | ||
72374 | neg find mustExist(problem, interpretation, newObject); | ||
72375 | } | ||
72376 | pattern createObject_FunctionalOutput_class_by_data_reference_FunctionalInterface_with_interface_reference_FunctionalData( | ||
72377 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
72378 | relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
72379 | container:DefinedElement) | ||
72380 | { | ||
72381 | find interpretation(problem,interpretation); | ||
72382 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
72383 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalOutput class"); | ||
72384 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
72385 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"data reference FunctionalInterface"); | ||
72386 | PartialInterpretation.partialrelationinterpretation(interpretation,inverseInterpretation); | ||
72387 | PartialRelationInterpretation.interpretationOf.name(inverseInterpretation,"interface reference FunctionalData"); | ||
72388 | find mustInstanceOfFunctionalInterface_class(problem,interpretation,container); | ||
72389 | find mayInstanceOfFunctionalOutput_class(problem,interpretation,newObject); | ||
72390 | find mayInRelationdata_reference_FunctionalInterface(problem,interpretation,container,newObject); | ||
72391 | find mustExist(problem, interpretation, container); | ||
72392 | neg find mustExist(problem, interpretation, newObject); | ||
72393 | } | ||
72394 | pattern createObject_FunctionalOutput_class( | ||
72395 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
72396 | typeInterpretation:PartialComplexTypeInterpretation) | ||
72397 | { | ||
72398 | find interpretation(problem,interpretation); | ||
72399 | neg find hasElementInContainment(problem,interpretation); | ||
72400 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
72401 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalOutput class"); | ||
72402 | find mayInstanceOfFunctionalOutput_class(problem,interpretation,newObject); | ||
72403 | find mayExist(problem, interpretation, newObject); | ||
72404 | neg find mustExist(problem, interpretation, newObject); | ||
72405 | } | ||
72406 | pattern createObject_FAMTerminator_class_by_terminator_reference_FunctionalData_with_data_reference_FAMTerminator( | ||
72407 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
72408 | relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
72409 | container:DefinedElement) | ||
72410 | { | ||
72411 | find interpretation(problem,interpretation); | ||
72412 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
72413 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FAMTerminator class"); | ||
72414 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
72415 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"terminator reference FunctionalData"); | ||
72416 | PartialInterpretation.partialrelationinterpretation(interpretation,inverseInterpretation); | ||
72417 | PartialRelationInterpretation.interpretationOf.name(inverseInterpretation,"data reference FAMTerminator"); | ||
72418 | find mustInstanceOfFunctionalData_class(problem,interpretation,container); | ||
72419 | find mayInstanceOfFAMTerminator_class(problem,interpretation,newObject); | ||
72420 | find mayInRelationterminator_reference_FunctionalData(problem,interpretation,container,newObject); | ||
72421 | find mustExist(problem, interpretation, container); | ||
72422 | neg find mustExist(problem, interpretation, newObject); | ||
72423 | } | ||
72424 | pattern createObject_FAMTerminator_class( | ||
72425 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
72426 | typeInterpretation:PartialComplexTypeInterpretation) | ||
72427 | { | ||
72428 | find interpretation(problem,interpretation); | ||
72429 | neg find hasElementInContainment(problem,interpretation); | ||
72430 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
72431 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FAMTerminator class"); | ||
72432 | find mayInstanceOfFAMTerminator_class(problem,interpretation,newObject); | ||
72433 | find mayExist(problem, interpretation, newObject); | ||
72434 | neg find mustExist(problem, interpretation, newObject); | ||
72435 | } | ||
72436 | pattern createObject_InformationLink_class_by_outgoingLinks_reference_FunctionalOutput_with_from_reference_InformationLink( | ||
72437 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
72438 | relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
72439 | container:DefinedElement) | ||
72440 | { | ||
72441 | find interpretation(problem,interpretation); | ||
72442 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
72443 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"InformationLink class"); | ||
72444 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
72445 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"outgoingLinks reference FunctionalOutput"); | ||
72446 | PartialInterpretation.partialrelationinterpretation(interpretation,inverseInterpretation); | ||
72447 | PartialRelationInterpretation.interpretationOf.name(inverseInterpretation,"from reference InformationLink"); | ||
72448 | find mustInstanceOfFunctionalOutput_class(problem,interpretation,container); | ||
72449 | find mayInstanceOfInformationLink_class(problem,interpretation,newObject); | ||
72450 | find mayInRelationoutgoingLinks_reference_FunctionalOutput(problem,interpretation,container,newObject); | ||
72451 | find mustExist(problem, interpretation, container); | ||
72452 | neg find mustExist(problem, interpretation, newObject); | ||
72453 | } | ||
72454 | pattern createObject_InformationLink_class( | ||
72455 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
72456 | typeInterpretation:PartialComplexTypeInterpretation) | ||
72457 | { | ||
72458 | find interpretation(problem,interpretation); | ||
72459 | neg find hasElementInContainment(problem,interpretation); | ||
72460 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
72461 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"InformationLink class"); | ||
72462 | find mayInstanceOfInformationLink_class(problem,interpretation,newObject); | ||
72463 | find mayExist(problem, interpretation, newObject); | ||
72464 | neg find mustExist(problem, interpretation, newObject); | ||
72465 | } | ||
72466 | pattern createObject_FunctionalInput_class_by_data_reference_FunctionalInterface_with_interface_reference_FunctionalData( | ||
72467 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
72468 | relationInterpretation:PartialRelationInterpretation, inverseInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, | ||
72469 | container:DefinedElement) | ||
72470 | { | ||
72471 | find interpretation(problem,interpretation); | ||
72472 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
72473 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalInput class"); | ||
72474 | PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); | ||
72475 | PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"data reference FunctionalInterface"); | ||
72476 | PartialInterpretation.partialrelationinterpretation(interpretation,inverseInterpretation); | ||
72477 | PartialRelationInterpretation.interpretationOf.name(inverseInterpretation,"interface reference FunctionalData"); | ||
72478 | find mustInstanceOfFunctionalInterface_class(problem,interpretation,container); | ||
72479 | find mayInstanceOfFunctionalInput_class(problem,interpretation,newObject); | ||
72480 | find mayInRelationdata_reference_FunctionalInterface(problem,interpretation,container,newObject); | ||
72481 | find mustExist(problem, interpretation, container); | ||
72482 | neg find mustExist(problem, interpretation, newObject); | ||
72483 | } | ||
72484 | pattern createObject_FunctionalInput_class( | ||
72485 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
72486 | typeInterpretation:PartialComplexTypeInterpretation) | ||
72487 | { | ||
72488 | find interpretation(problem,interpretation); | ||
72489 | neg find hasElementInContainment(problem,interpretation); | ||
72490 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
72491 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalInput class"); | ||
72492 | find mayInstanceOfFunctionalInput_class(problem,interpretation,newObject); | ||
72493 | find mayExist(problem, interpretation, newObject); | ||
72494 | neg find mustExist(problem, interpretation, newObject); | ||
72495 | } | ||
72496 | pattern createObject_FunctionalArchitectureModel_class( | ||
72497 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
72498 | typeInterpretation:PartialComplexTypeInterpretation) | ||
72499 | { | ||
72500 | find interpretation(problem,interpretation); | ||
72501 | neg find hasElementInContainment(problem,interpretation); | ||
72502 | PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); | ||
72503 | PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"FunctionalArchitectureModel class"); | ||
72504 | find mayInstanceOfFunctionalArchitectureModel_class(problem,interpretation,newObject); | ||
72505 | find mayExist(problem, interpretation, newObject); | ||
72506 | neg find mustExist(problem, interpretation, newObject); | ||
72507 | } | ||
72508 | |||
72509 | ////////// | ||
72510 | // 4.2 Type refinement | ||
72511 | ////////// | ||
72512 | pattern refineTypeTo_FunctionalInterface_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
72513 | find interpretation(problem,interpretation); | ||
72514 | PartialInterpretation.newElements(interpretation,element); | ||
72515 | find mayInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
72516 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
72517 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
72518 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
72519 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
72520 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
72521 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
72522 | } | ||
72523 | pattern refineTypeTo_Function_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
72524 | find interpretation(problem,interpretation); | ||
72525 | PartialInterpretation.newElements(interpretation,element); | ||
72526 | find mayInstanceOfFunction_class(problem,interpretation,element); | ||
72527 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
72528 | neg find mustInstanceOfFunction_class(problem,interpretation,element); | ||
72529 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
72530 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
72531 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
72532 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
72533 | } | ||
72534 | pattern refineTypeTo_FunctionalOutput_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
72535 | find interpretation(problem,interpretation); | ||
72536 | PartialInterpretation.newElements(interpretation,element); | ||
72537 | find mayInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
72538 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
72539 | neg find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
72540 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
72541 | neg find mustInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
72542 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
72543 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
72544 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
72545 | } | ||
72546 | pattern refineTypeTo_FAMTerminator_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
72547 | find interpretation(problem,interpretation); | ||
72548 | PartialInterpretation.newElements(interpretation,element); | ||
72549 | find mayInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
72550 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
72551 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
72552 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
72553 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
72554 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
72555 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
72556 | } | ||
72557 | pattern refineTypeTo_InformationLink_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
72558 | find interpretation(problem,interpretation); | ||
72559 | PartialInterpretation.newElements(interpretation,element); | ||
72560 | find mayInstanceOfInformationLink_class(problem,interpretation,element); | ||
72561 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
72562 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
72563 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
72564 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
72565 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
72566 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
72567 | } | ||
72568 | pattern refineTypeTo_FunctionalInput_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
72569 | find interpretation(problem,interpretation); | ||
72570 | PartialInterpretation.newElements(interpretation,element); | ||
72571 | find mayInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
72572 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
72573 | neg find mustInstanceOfFunctionalOutput_class(problem,interpretation,element); | ||
72574 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
72575 | neg find mustInstanceOfFunctionalInput_class(problem,interpretation,element); | ||
72576 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
72577 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
72578 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
72579 | } | ||
72580 | pattern refineTypeTo_FunctionalArchitectureModel_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { | ||
72581 | find interpretation(problem,interpretation); | ||
72582 | PartialInterpretation.newElements(interpretation,element); | ||
72583 | find mayInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
72584 | neg find mustInstanceOfFunctionalInterface_class(problem,interpretation,element); | ||
72585 | neg find mustInstanceOfFAMTerminator_class(problem,interpretation,element); | ||
72586 | neg find mustInstanceOfFunctionalData_class(problem,interpretation,element); | ||
72587 | neg find mustInstanceOfInformationLink_class(problem,interpretation,element); | ||
72588 | neg find mustInstanceOfFunctionalElement_class(problem,interpretation,element); | ||
72589 | neg find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,element); | ||
72590 | } | ||
72591 | |||
72592 | ////////// | ||
72593 | // 4.3 Relation refinement | ||
72594 | ////////// | ||
72595 | pattern refineRelation_model_reference_FunctionalElement( | ||
72596 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
72597 | relationIterpretation:PartialRelationInterpretation, | ||
72598 | from: DefinedElement, to: DefinedElement) | ||
72599 | { | ||
72600 | find interpretation(problem,interpretation); | ||
72601 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
72602 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"model reference FunctionalElement"); | ||
72603 | find mustExist(problem, interpretation, from); | ||
72604 | find mustExist(problem, interpretation, to); | ||
72605 | find mustInstanceOfFunctionalElement_class(problem,interpretation,from); | ||
72606 | find mustInstanceOfFunctionalArchitectureModel_class(problem,interpretation,to); | ||
72607 | find mayInRelationmodel_reference_FunctionalElement(problem,interpretation,from,to); | ||
72608 | neg find mustInRelationmodel_reference_FunctionalElement(problem,interpretation,from,to); | ||
72609 | } | ||
72610 | pattern refineRelation_IncomingLinks_reference_FunctionalInput_and_to_reference_InformationLink( | ||
72611 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
72612 | relationIterpretation:PartialRelationInterpretation, oppositeInterpretation:PartialRelationInterpretation, | ||
72613 | from: DefinedElement, to: DefinedElement) | ||
72614 | { | ||
72615 | find interpretation(problem,interpretation); | ||
72616 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
72617 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"IncomingLinks reference FunctionalInput"); | ||
72618 | PartialInterpretation.partialrelationinterpretation(interpretation,oppositeInterpretation); | ||
72619 | PartialRelationInterpretation.interpretationOf.name(oppositeInterpretation,"to reference InformationLink"); | ||
72620 | find mustExist(problem, interpretation, from); | ||
72621 | find mustExist(problem, interpretation, to); | ||
72622 | find mustInstanceOfFunctionalInput_class(problem,interpretation,from); | ||
72623 | find mustInstanceOfInformationLink_class(problem,interpretation,to); | ||
72624 | find mayInRelationIncomingLinks_reference_FunctionalInput(problem,interpretation,from,to); | ||
72625 | neg find mustInRelationIncomingLinks_reference_FunctionalInput(problem,interpretation,from,to); | ||
72626 | } | ||
72627 | pattern refineRelation_type_attribute_Function( | ||
72628 | problem:LogicProblem, interpretation:PartialInterpretation, | ||
72629 | relationIterpretation:PartialRelationInterpretation, | ||
72630 | from: DefinedElement, to: DefinedElement) | ||
72631 | { | ||
72632 | find interpretation(problem,interpretation); | ||
72633 | PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); | ||
72634 | PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"type attribute Function"); | ||
72635 | find mustExist(problem, interpretation, from); | ||
72636 | find mustExist(problem, interpretation, to); | ||
72637 | find mustInstanceOfFunction_class(problem,interpretation,from); | ||
72638 | find mustInstanceOfFunctionType_enum(problem,interpretation,to); | ||
72639 | find mayInRelationtype_attribute_Function(problem,interpretation,from,to); | ||
72640 | neg find mustInRelationtype_attribute_Function(problem,interpretation,from,to); | ||
72641 | } | ||
diff --git a/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/outputs/fam/debug/generation.logicproblem b/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/outputs/fam/debug/generation.logicproblem index 061a233a..296c3a70 100644 --- a/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/outputs/fam/debug/generation.logicproblem +++ b/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/outputs/fam/debug/generation.logicproblem | |||
@@ -1,7 +1,7 @@ | |||
1 | <?xml version="1.0" encoding="ASCII"?> | 1 | <?xml version="1.0" encoding="ASCII"?> |
2 | <language:LogicProblem xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore2logicannotations="http://www.bme.hu/mit/inf/dslreasoner/logic/model/language/ecore2logicannotation" xmlns:language="http://www.bme.hu/mit/inf/dslreasoner/logic/model/problem" xmlns:language_1="http://www.bme.hu/mit/inf/dslreasoner/logic/model/language" xmlns:viatra2logicannotations="http://www.bme.hu/mit/inf/dslreasoner/logic/model/language/viatra2logicannotation"> | 2 | <language:LogicProblem xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore2logicannotations="http://www.bme.hu/mit/inf/dslreasoner/logic/model/language/ecore2logicannotation" xmlns:language="http://www.bme.hu/mit/inf/dslreasoner/logic/model/problem" xmlns:language_1="http://www.bme.hu/mit/inf/dslreasoner/logic/model/language"> |
3 | <types xsi:type="language_1:TypeDeclaration" name="FunctionalElement class" subtypes="//@types.2" isAbstract="true"/> | 3 | <types xsi:type="language_1:TypeDeclaration" name="FunctionalElement class" subtypes="//@types.2" isAbstract="true"/> |
4 | <types xsi:type="language_1:TypeDeclaration" name="FunctionalArchitectureModel class" subtypes="//@types.10 //@types.11" isAbstract="true"/> | 4 | <types xsi:type="language_1:TypeDeclaration" name="FunctionalArchitectureModel class"/> |
5 | <types xsi:type="language_1:TypeDeclaration" name="Function class" supertypes="//@types.0"/> | 5 | <types xsi:type="language_1:TypeDeclaration" name="Function class" supertypes="//@types.0"/> |
6 | <types xsi:type="language_1:TypeDeclaration" name="FAMTerminator class"/> | 6 | <types xsi:type="language_1:TypeDeclaration" name="FAMTerminator class"/> |
7 | <types xsi:type="language_1:TypeDeclaration" name="InformationLink class"/> | 7 | <types xsi:type="language_1:TypeDeclaration" name="InformationLink class"/> |
@@ -10,8 +10,6 @@ | |||
10 | <types xsi:type="language_1:TypeDeclaration" name="FunctionalOutput class" supertypes="//@types.8"/> | 10 | <types xsi:type="language_1:TypeDeclaration" name="FunctionalOutput class" supertypes="//@types.8"/> |
11 | <types xsi:type="language_1:TypeDeclaration" name="FunctionalData class" subtypes="//@types.6 //@types.7" isAbstract="true"/> | 11 | <types xsi:type="language_1:TypeDeclaration" name="FunctionalData class" subtypes="//@types.6 //@types.7" isAbstract="true"/> |
12 | <types xsi:type="language_1:TypeDefinition" name="FunctionType enum" elements="//@elements.0 //@elements.1 //@elements.2"/> | 12 | <types xsi:type="language_1:TypeDefinition" name="FunctionType enum" elements="//@elements.0 //@elements.1 //@elements.2"/> |
13 | <types xsi:type="language_1:TypeDefinition" name="FunctionalArchitectureModel class DefinedPart" supertypes="//@types.1" elements="//@elements.3"/> | ||
14 | <types xsi:type="language_1:TypeDeclaration" name="FunctionalArchitectureModel class UndefinedPart" supertypes="//@types.1"/> | ||
15 | <assertions name="upperMultiplicity interface FunctionalElement" annotations="//@annotations.0"> | 13 | <assertions name="upperMultiplicity interface FunctionalElement" annotations="//@annotations.0"> |
16 | <value xsi:type="language_1:Forall"> | 14 | <value xsi:type="language_1:Forall"> |
17 | <quantifiedVariables name="src"> | 15 | <quantifiedVariables name="src"> |
@@ -496,22 +494,6 @@ | |||
496 | </expression> | 494 | </expression> |
497 | </value> | 495 | </value> |
498 | </assertions> | 496 | </assertions> |
499 | <assertions name="errorpattern ca mcgill ecse dslreasoner standalone test fam queries terminatorAndInformation" annotations="//@annotations.20"> | ||
500 | <value xsi:type="language_1:Forall"> | ||
501 | <quantifiedVariables name="p0"> | ||
502 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.3"/> | ||
503 | </quantifiedVariables> | ||
504 | <quantifiedVariables name="p1"> | ||
505 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.4"/> | ||
506 | </quantifiedVariables> | ||
507 | <expression xsi:type="language_1:Not"> | ||
508 | <operand xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.15"> | ||
509 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.19/@value/@quantifiedVariables.0"/> | ||
510 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@assertions.19/@value/@quantifiedVariables.1"/> | ||
511 | </operand> | ||
512 | </expression> | ||
513 | </value> | ||
514 | </assertions> | ||
515 | <relations xsi:type="language_1:RelationDeclaration" name="interface reference FunctionalElement"> | 497 | <relations xsi:type="language_1:RelationDeclaration" name="interface reference FunctionalElement"> |
516 | <parameters xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> | 498 | <parameters xsi:type="language_1:ComplexTypeReference" referred="//@types.0"/> |
517 | <parameters xsi:type="language_1:ComplexTypeReference" referred="//@types.5"/> | 499 | <parameters xsi:type="language_1:ComplexTypeReference" referred="//@types.5"/> |
@@ -572,53 +554,10 @@ | |||
572 | <parameters xsi:type="language_1:ComplexTypeReference" referred="//@types.2"/> | 554 | <parameters xsi:type="language_1:ComplexTypeReference" referred="//@types.2"/> |
573 | <parameters xsi:type="language_1:ComplexTypeReference" referred="//@types.9"/> | 555 | <parameters xsi:type="language_1:ComplexTypeReference" referred="//@types.9"/> |
574 | </relations> | 556 | </relations> |
575 | <relations xsi:type="language_1:RelationDefinition" name="pattern ca mcgill ecse dslreasoner standalone test fam queries terminatorAndInformation" annotations="//@annotations.19"> | ||
576 | <parameters xsi:type="language_1:ComplexTypeReference" referred="//@types.3"/> | ||
577 | <parameters xsi:type="language_1:ComplexTypeReference" referred="//@types.4"/> | ||
578 | <variables name="parameter T"> | ||
579 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.3"/> | ||
580 | </variables> | ||
581 | <variables name="parameter I"> | ||
582 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.4"/> | ||
583 | </variables> | ||
584 | <value xsi:type="language_1:Or"> | ||
585 | <operands xsi:type="language_1:Exists"> | ||
586 | <quantifiedVariables name="variable Out"> | ||
587 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.7"/> | ||
588 | </quantifiedVariables> | ||
589 | <expression xsi:type="language_1:And"> | ||
590 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.11"> | ||
591 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.15/@value/@operands.0/@quantifiedVariables.0"/> | ||
592 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.15/@variables.1"/> | ||
593 | </operands> | ||
594 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.12"> | ||
595 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.15/@value/@operands.0/@quantifiedVariables.0"/> | ||
596 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.15/@variables.0"/> | ||
597 | </operands> | ||
598 | </expression> | ||
599 | </operands> | ||
600 | <operands xsi:type="language_1:Exists"> | ||
601 | <quantifiedVariables name="variable In"> | ||
602 | <range xsi:type="language_1:ComplexTypeReference" referred="//@types.6"/> | ||
603 | </quantifiedVariables> | ||
604 | <expression xsi:type="language_1:And"> | ||
605 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.7"> | ||
606 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.15/@variables.1"/> | ||
607 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.15/@value/@operands.1/@quantifiedVariables.0"/> | ||
608 | </operands> | ||
609 | <operands xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.12"> | ||
610 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.15/@value/@operands.1/@quantifiedVariables.0"/> | ||
611 | <parameterSubstitutions xsi:type="language_1:SymbolicValue" symbolicReference="//@relations.15/@variables.0"/> | ||
612 | </operands> | ||
613 | </expression> | ||
614 | </operands> | ||
615 | </value> | ||
616 | </relations> | ||
617 | <elements name="Root literal FunctionType" definedInType="//@types.9"/> | 557 | <elements name="Root literal FunctionType" definedInType="//@types.9"/> |
618 | <elements name="Intermediate literal FunctionType" definedInType="//@types.9"/> | 558 | <elements name="Intermediate literal FunctionType" definedInType="//@types.9"/> |
619 | <elements name="Leaf literal FunctionType" definedInType="//@types.9"/> | 559 | <elements name="Leaf literal FunctionType" definedInType="//@types.9"/> |
620 | <elements name="o 1" definedInType="//@types.10"/> | 560 | <containmentHierarchies typesOrderedInHierarchy="//@types.1 //@types.6 //@types.7 //@types.3 //@types.5 //@types.2 //@types.4 //@types.0 //@types.8" containmentRelations="//@relations.0 //@relations.3 //@relations.4 //@relations.8 //@relations.11 //@relations.12"/> |
621 | <containmentHierarchies typesOrderedInHierarchy="//@types.7 //@types.1 //@types.4 //@types.3 //@types.5 //@types.0 //@types.8 //@types.6 //@types.2 //@types.10 //@types.11" containmentRelations="//@relations.0 //@relations.3 //@relations.4 //@relations.8 //@relations.11 //@relations.12"/> | ||
622 | <annotations xsi:type="ecore2logicannotations:UpperMultiplicityAssertion" target="//@assertions.0" relation="//@relations.0" upper="1"/> | 561 | <annotations xsi:type="ecore2logicannotations:UpperMultiplicityAssertion" target="//@assertions.0" relation="//@relations.0" upper="1"/> |
623 | <annotations xsi:type="ecore2logicannotations:LowerMultiplicityAssertion" target="//@assertions.1" relation="//@relations.1" lower="1"/> | 562 | <annotations xsi:type="ecore2logicannotations:LowerMultiplicityAssertion" target="//@assertions.1" relation="//@relations.1" lower="1"/> |
624 | <annotations xsi:type="ecore2logicannotations:UpperMultiplicityAssertion" target="//@assertions.2" relation="//@relations.1" upper="1"/> | 563 | <annotations xsi:type="ecore2logicannotations:UpperMultiplicityAssertion" target="//@assertions.2" relation="//@relations.1" upper="1"/> |
@@ -638,6 +577,4 @@ | |||
638 | <annotations xsi:type="ecore2logicannotations:InverseRelationAssertion" target="//@assertions.16" inverseA="//@relations.8" inverseB="//@relations.13"/> | 577 | <annotations xsi:type="ecore2logicannotations:InverseRelationAssertion" target="//@assertions.16" inverseA="//@relations.8" inverseB="//@relations.13"/> |
639 | <annotations xsi:type="ecore2logicannotations:LowerMultiplicityAssertion" target="//@assertions.17" relation="//@relations.14" lower="1"/> | 578 | <annotations xsi:type="ecore2logicannotations:LowerMultiplicityAssertion" target="//@assertions.17" relation="//@relations.14" lower="1"/> |
640 | <annotations xsi:type="ecore2logicannotations:UpperMultiplicityAssertion" target="//@assertions.18" relation="//@relations.14" upper="1"/> | 579 | <annotations xsi:type="ecore2logicannotations:UpperMultiplicityAssertion" target="//@assertions.18" relation="//@relations.14" upper="1"/> |
641 | <annotations xsi:type="viatra2logicannotations:TransfomedViatraQuery" target="//@relations.15" patternFullyQualifiedName="ca.mcgill.ecse.dslreasoner.standalone.test.fam.queries.terminatorAndInformation"/> | ||
642 | <annotations xsi:type="viatra2logicannotations:TransformedViatraWellformednessConstraint" target="//@assertions.19" query="//@annotations.19"/> | ||
643 | </language:LogicProblem> | 580 | </language:LogicProblem> |
diff --git a/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/outputs/fam/debug/init.partialmodel b/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/outputs/fam/debug/init.partialmodel index 3f2640d6..55020b90 100644 --- a/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/outputs/fam/debug/init.partialmodel +++ b/Tests/ca.mcgill.ecse.dslreasoner.standalone.test/outputs/fam/debug/init.partialmodel | |||
@@ -1,5 +1,5 @@ | |||
1 | <?xml version="1.0" encoding="ASCII"?> | 1 | <?xml version="1.0" encoding="ASCII"?> |
2 | <partialinterpretation:PartialInterpretation xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:language="http://www.bme.hu/mit/inf/dslreasoner/logic/model/language" xmlns:partialinterpretation="http://www.bme.hu/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage" minNewElements="6" maxNewElements="6"> | 2 | <partialinterpretation:PartialInterpretation xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:language="http://www.bme.hu/mit/inf/dslreasoner/logic/model/language" xmlns:partialinterpretation="http://www.bme.hu/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage" minNewElements="7" maxNewElements="7"> |
3 | <problem href="generation.logicproblem#/"/> | 3 | <problem href="generation.logicproblem#/"/> |
4 | <partialrelationinterpretation> | 4 | <partialrelationinterpretation> |
5 | <interpretationOf href="generation.logicproblem#//@relations.0"/> | 5 | <interpretationOf href="generation.logicproblem#//@relations.0"/> |
@@ -86,7 +86,6 @@ | |||
86 | <interpretationOf href="generation.logicproblem#//@types.0"/> | 86 | <interpretationOf href="generation.logicproblem#//@types.0"/> |
87 | </partialtypeinterpratation> | 87 | </partialtypeinterpratation> |
88 | <partialtypeinterpratation xsi:type="partialinterpretation:PartialComplexTypeInterpretation" scopes="//@scopes.1"> | 88 | <partialtypeinterpratation xsi:type="partialinterpretation:PartialComplexTypeInterpretation" scopes="//@scopes.1"> |
89 | <elements href="generation.logicproblem#//@elements.3"/> | ||
90 | <interpretationOf href="generation.logicproblem#//@types.1"/> | 89 | <interpretationOf href="generation.logicproblem#//@types.1"/> |
91 | </partialtypeinterpratation> | 90 | </partialtypeinterpratation> |
92 | <partialtypeinterpratation xsi:type="partialinterpretation:PartialComplexTypeInterpretation" scopes="//@scopes.2" supertypeInterpretation="//@partialtypeinterpratation.4"> | 91 | <partialtypeinterpratation xsi:type="partialinterpretation:PartialComplexTypeInterpretation" scopes="//@scopes.2" supertypeInterpretation="//@partialtypeinterpratation.4"> |
@@ -110,9 +109,6 @@ | |||
110 | <partialtypeinterpratation xsi:type="partialinterpretation:PartialComplexTypeInterpretation" scopes="//@scopes.8"> | 109 | <partialtypeinterpratation xsi:type="partialinterpretation:PartialComplexTypeInterpretation" scopes="//@scopes.8"> |
111 | <interpretationOf href="generation.logicproblem#//@types.8"/> | 110 | <interpretationOf href="generation.logicproblem#//@types.8"/> |
112 | </partialtypeinterpratation> | 111 | </partialtypeinterpratation> |
113 | <partialtypeinterpratation xsi:type="partialinterpretation:PartialComplexTypeInterpretation" scopes="//@scopes.9" supertypeInterpretation="//@partialtypeinterpratation.5"> | ||
114 | <interpretationOf href="generation.logicproblem#//@types.11"/> | ||
115 | </partialtypeinterpratation> | ||
116 | <openWorldElements xsi:type="partialinterpretation:IntegerElement" name="New Integers"/> | 112 | <openWorldElements xsi:type="partialinterpretation:IntegerElement" name="New Integers"/> |
117 | <openWorldElements xsi:type="partialinterpretation:RealElement" name="New Reals"/> | 113 | <openWorldElements xsi:type="partialinterpretation:RealElement" name="New Reals"/> |
118 | <openWorldElements xsi:type="partialinterpretation:StringElement" name="New Strings"/> | 114 | <openWorldElements xsi:type="partialinterpretation:StringElement" name="New Strings"/> |
@@ -126,5 +122,4 @@ | |||
126 | <scopes targetTypeInterpretation="//@partialtypeinterpratation.10"/> | 122 | <scopes targetTypeInterpretation="//@partialtypeinterpratation.10"/> |
127 | <scopes targetTypeInterpretation="//@partialtypeinterpratation.11"/> | 123 | <scopes targetTypeInterpretation="//@partialtypeinterpratation.11"/> |
128 | <scopes targetTypeInterpretation="//@partialtypeinterpratation.12"/> | 124 | <scopes targetTypeInterpretation="//@partialtypeinterpratation.12"/> |
129 | <scopes targetTypeInterpretation="//@partialtypeinterpratation.13"/> | ||
130 | </partialinterpretation:PartialInterpretation> | 125 | </partialinterpretation:PartialInterpretation> |