indexExists :: OFL -> String -> ValidationResult
indexExists ofl name = if (hasIndex ofl name) then validationSuccess else validationFailure $ "Unknown index " ++ name
+indexIsType :: OFL -> String -> IndexType -> ValidationResult
+indexIsType ofl name indexType = case indexType == (getIndexType ofl name) of
+ True -> validationSuccess
+ False -> validationFailure $ "Expected index " ++ name ++ " to be be of type " ++ show indexType
+
valueExists :: OFL -> String -> ValidationResult
valueExists ofl name = if (hasValue ofl name) then validationSuccess else validationFailure $ "Unknown value " ++ name
validateExpression ofl b;
}
-
validateExpression ofl (PositionComponent i) = do {
indexExists ofl i;
+ indexIsType ofl i SpatialIndex
}
validateExpression ofl (Derivative e i) = do {
validateExpression ofl e;
indexExists ofl i;
+ indexIsType ofl i SpatialIndex
}