/*
 * generated by Xtext 2.12.0
 */
package com.irtsaintexupery.xtext.pseim.validation

import com.irtsaintexupery.pseim.pseim.Pattern
import org.eclipse.xtext.validation.Check

/**
 * This class contains custom validation rules. 
 *
 * See https://www.eclipse.org/Xtext/documentation/303_runtime_concepts.html#validation
 */
class PatternValidator extends AbstractPatternValidator {
	
//	public static val INVALID_NAME = 'invalidName'
//
//	@Check
//	def checkGreetingStartsWithCapital(Greeting greeting) {
//		if (!Character.isUpperCase(greeting.name.charAt(0))) {
//			warning('Name should start with a capital', 
//					PatternPackage.Literals.GREETING__NAME,
//					INVALID_NAME)
//		}
//	}
	
	@Check
	def checkPattern(Pattern p) {
		// Static checking
			// Check if there exists a solution for the set of constraints induced by the pattern model (all links + constraints)
			// Warning: Two variables are necessarily identical -> Potential error as there is redundancy in the variables
			//												   -> Maybe it is not an error as in creates different interfaces for the pattern
			// Global arithmetic constraints may be added to the pattern language (no need for now)
		// TODO Dynamic synthesis (in the Mapping MM validator)
			// A synthesis tool synthesizes a solution for the mapping
			// If there is no solution, then the mapping is not correct
		// In both cases, we need a bridge between our model and a solver 
	}
	
}
