From 2492b5f012b045917e7261bd5c78b432ec4d3dc6 Mon Sep 17 00:00:00 2001 From: Aren Babikian Date: Fri, 15 Jan 2021 04:40:17 -0500 Subject: Begin vql implementation + fix enums bug --- .../queries/crossingScenarioQueries.vql | 83 ++++++++++++---------- 1 file changed, 46 insertions(+), 37 deletions(-) (limited to 'Domains/crossingScenario/queries/crossingScenarioQueries.vql') diff --git a/Domains/crossingScenario/queries/crossingScenarioQueries.vql b/Domains/crossingScenario/queries/crossingScenarioQueries.vql index fbd68472..7089d0da 100644 --- a/Domains/crossingScenario/queries/crossingScenarioQueries.vql +++ b/Domains/crossingScenario/queries/crossingScenarioQueries.vql @@ -3,51 +3,60 @@ package queries import "http://www.example.com/crossingScenario" import "http://www.eclipse.org/emf/2002/Ecore" -//Minimal Failing Example +////Minimal Failing Example @Constraint(severity = "error", key = {l}, message = "this defines the placedOn relation") pattern patterThatOnlyWorksWithInt(l : Lane) { Lane.referenceCoord(l, w); - check(w <= 2.0); + check(w <= 0-10.0); } -//////////////// -////Lane -//////////////// -// -///////////width, numWidth -//@Constraint(severity="error", key={l}, message="x") -//pattern define_numWidth_small(l : Lane) { -// Lane.width(l, Size::Small); -// Lane.numWidth(l, nw); -// check(nw <= 5); -//} or { -// Lane.width(l, Size::Small); -// Lane.numWidth(l, nw); -// check(nw >= 10); -//} -// -//@Constraint(severity="error", key={l}, message="x") -//pattern define_numWidth_medium(l : Lane) { -// Lane.width(l, Size::Medium); -// Lane.numWidth(l, nw); -// check(nw <= 10); -//} or { -// Lane.width(l, Size::Medium); -// Lane.numWidth(l, nw); -// check(nw >= 15); -//} -// +////////////// +//Lane +////////////// + +/////////width, numWidth //@Constraint(severity="error", key={l}, message="x") -//pattern define_numWidth_large(l : Lane) { -// Lane.width(l, Size::Large); -// Lane.numWidth(l, nw); -// check(nw <= 15); -//} or { -// Lane.width(l, Size::Large); +//pattern define_numWidth_small1(l : Lane) { +// Lane.width(l, Size::S_Small); // Lane.numWidth(l, nw); -// check(nw >= 20); +// check(nw >= 5.0); //} -// + +@Constraint(severity="error", key={l}, message="x") +pattern define_numWidth_small(l : Lane) { + Lane.width(l, Size::S_Small); + Lane.numWidth(l, nw); + check(nw <= 5.0); +} or { + Lane.width(l, Size::S_Small); + Lane.numWidth(l, nw); + check(nw >= 10.0); +} + +@Constraint(severity="error", key={l}, message="x") +pattern define_numWidth_medium(l : Lane) { + Lane.width(l, ::S_Med); + Lane.numWidth(l, nw); + check(nw <= 10.0); +} +or { + Lane.width(l, Size::S_Med); + Lane.numWidth(l, nw); + check(nw >= 15.0); +} + +@Constraint(severity="error", key={l}, message="x") +pattern define_numWidth_large(l : Lane) { + Lane.width(l, Size::S_Large); + Lane.numWidth(l, nw); + check(nw <= 15.0); +} +or { + Lane.width(l, Size::S_Large); + Lane.numWidth(l, nw); + check(nw >= 20.0); +} + ///////////referenceCoord //@Constraint(severity="error", key={l}, message="x") //pattern define_referenceCoord_horizontalAtOrigin(l:Lane) { -- cgit v1.2.3-54-g00ecf