You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Universal patterns syntax for links should be defined as structure in Links Notation.
It should be possible to match any link.
It should be possible to match variables that can be used in the pattern's substitution.
It should be possible to create user defined patterns/sub-patterns.
Each built-in sub-patterns should be defined in the same syntax where it is possible.
`*` - any
`set` - any set
`sequence` - any sequence
`tree` - any tree
`point` - any point
`partial-point` - any partial point
`$x`, `$y` - variables
-- expanded variable (varible with preset pattern of contents)
-- $x is equivalent to ($ x *)
(($ x tree) *)
(* ($ y point))
-- (1 1):
-- (* *):
(1: 1 1)
-- Concrete set
-- (set (1 2))
-- should match both:
(1 2)
(2 1)
-- Point
(pattern
(name "point")
($x: $x $x)
)
-- Partial point
(pattern
(name "partial-point")
(or
($x: $x *)
($x: * $x)
)
)
-- Tree
-- #element is argument, where any template can be placed
-- tree here is self reference to pattern
(pattern
(name "tree")
(or
#element
(or
(#element #element)
(or
(tree #element)
(#element tree)
)
)
)
)
-- is equivalent to
(pattern
(name "tree")
(or
#element
(#element #element)
(tree #element)
(#element tree)
)
)
-- it is possible to use alternative syntax for "or"
(pattern
(name "tree")
(|
#element
(#element #element)
(tree #element)
(#element tree)
)
)
-- or syntax
(or $x $y)
(| $x $y)
-- and syntax
(and $x $y)
(& $x $y)
-- not syntax
(not $x)
(! $x)
-- "link address is greater than" syntax
(gt 5)
(> 5)
-- "link address is greater or equal to" syntax
(gte 5)
(>= 5)
-- "link address is less than" syntax
(lt 5)
(< 5)
-- "link address is greater or equal to" syntax
(lte 5)
(<= 5)
-- incoming links syntax
(in $x)
-- outgoing links syntax
(out $x)
-- Concrete Tree
-- tree with element argument set to point template
-- (tree (element point))
-- How to define Set?
-- How to define Sequence?
-- Trigger/Substitution
-- pattern in the transformation can receive sequence/set of templates
-- and each of them can be assigned to variable
-- here the set/sequence consists of single doublet
-- this transformation corresponds to update transformation
(transform-once
(pattern ($x $y))
(pattern ($y $x))
)
-- creation transformation
(transform-once
(pattern ())
(pattern (1 2))
)
-- deletion transformation
(transform-once
(pattern ($x: * *))
(pattern ())
)
-- always transform (handlers)
(transform-always
(pattern
(and
($x: * *)
(not (* logged))
)
)
(pattern ($x logged))
)
(* *) and ($x $y) would match the same number of links.
Universal patterns syntax for links should be defined as structure in Links Notation.
It should be possible to match any link.
It should be possible to match variables that can be used in the pattern's substitution.
It should be possible to create user defined patterns/sub-patterns.
Each built-in sub-patterns should be defined in the same syntax where it is possible.
(* *)
and($x $y)
would match the same number of links.Related to #346.
The text was updated successfully, but these errors were encountered: