User Tools

Site Tools


groimp-platform:xl-predicates

Query predicates

These predicates are used in the queries. Note that the description of the predicate is simplified. Please refer to the XL specification to see the complete definition.

All of the examples are part of patterns (on the left hand side in rule query, or in expression query (**) ).

Note: Some predicate syntax are the same as some production operator syntax. e.g. the path predicates look exactly the same. The operate differently internally thought. But, they have usually the same usage.

Simple predicate

syntax description example
ID ':.' create a variable ID and assign it the default type of the graph (Node). x:.
ID1 ':' ID2 as before, but the variable ID1 is of type ID2 x:X
ID'('param')' create variables that matches the param given. Arguments can be skipped with either nothing or '.' X(,a,,b,.)
'^' push the expression that follow to the root of the current extent ^X

Path predicate

whitespace get connection with previous node, if any, by a successor edge
> get connection node with previous by a successor edge
< get connection node with previous by a reverse successor edge
<-> get connection node with previous by successor edges in both directions
--- get connection node with previous by a successor edge if there does not yet exist such an edge in either direction
+>, <+, <+>, -+- as before, but branch instead of successor edges
/>, </, </>, -/- as before, but refinement instead of successor edges
-e->, <-e-, <-e->, -e- with an int-valued expression e as before, but edges of type e instead of successor edges
-n-> with a node-valued expression n get a compound edge with n encoding the edge data
<-n- with a node-valued expression n as before, but reverse direction
[, ] define the starts and the end of a branch connected subgraph

Control flow predicate

These predicates govern the control flow of pattern matching.

'(' predicate ')!' First element predicate No idea how it works
'(' predicate ')' X with X being one of the '?', '+', '*', '{'range'}' apply the pattern to find '?' possibly one, '+' exactly one, '*' any, '{range}' the amount in the range Node (+>)? Node
Node (+>){1:2} Node
with +> being the pattern
'(' X predicate ')' with X being '?', '+', '*', ':' as before I guess Node (: +> Node)
groimp-platform/xl-predicates.txt · Last modified: 2025/01/10 15:38 by gaetan