Commit graph

5255 commits

Author SHA1 Message Date
66bbf146a6 LocationSolver: implement this additional resolving flavour
coverPartially() now computes coverage solution and moves
that solution into place, while retaining the extraneous, uncovered part
2018-02-09 03:30:45 +01:00
c88a68a2a0 LocationSolver: need yet another flavour of the coordinate resolving mechanism
...this happens when you design a subsystem bottom-up
You build five items just to find out that in fact you need only a sixth item....
2018-02-08 03:00:38 +01:00
6022a8afb1 LocationSolver: draft outline of the solving loop 2018-02-08 02:50:48 +01:00
bf314482da LocationSolver: draft the simple usage scenario (unit test) (#1127) 2018-02-08 00:37:02 +01:00
1238d416fc LocationSolver: draft the DSL syntax for sequential alternatives (#1126)
turns out to be somewhat tricky.
The easy shot would be to use the comma operator,
but I don't like that idea, since in logic programming, comma means "and then".

So I prefer an || operator, similar to short-circuit evaluation of boolean OR

Unfortunately, OR binds stronger than assignment, so we need to trick our way
into a smooth DSL syntax by wrapping into intermediary marker types, and accept
rvalue references only, as additional safeguard to enforce the intended inline
definition syntax typical for DSL usage.
2018-02-07 04:24:33 +01:00
10d2cafba9 LocationSolver: draft entities involved in location solving (#1127)
basically this will be built on top of the path matching / resolving mechanism coded thus far.
but we'll need some additional flags and some DSL magic
2018-02-07 04:03:39 +01:00
136e78d023 DockAccess: decide on next steps towards integration (#1126) 2018-02-01 23:08:43 +01:00
134048949c DockAccess: further planning of the location resolution process 2018-01-25 22:45:05 +01:00
1334dfb00d DockAccess: consider how to access the "location query" service
...which also involves some concept how actually to resolve location specifications
2018-01-15 03:56:28 +01:00
3c32cd5acb UI-top-level: decide upon the relation of ViewLocator and Navigator
...and how the former can rely on the latter, abstracted as LocationQuery
2018-01-15 03:56:28 +01:00
d0b59a1c52 GUI-source: rename "util" namespace to "draw"
...which avoids the possible ambiguity with the global util namespace
Moreover, this name seems more adequate to what we're doing here anyway
2018-01-15 03:56:28 +01:00
22e823fad5 DockAccess: finish setup of allocation specifications within the DSL 2018-01-15 03:56:23 +01:00
b6961e8f03 DockAccess: better pass functor as const& into partial application
seems to be the most orthogonal way to strip adornments from the SIG type
Moreover, we want to move the functor into the closure, where it will be stored anyay.
From there on, we can pass as const& into the binder (for creating the partially closed functor)
2018-01-13 00:58:08 +01:00
90a5d76fc9 DockAccess: solution how to bind partial application into generic lambda
...as it turned out, the result type was the problem: the lambda we provide
typically does not yield an Allocator, but only its baseclass function<UICoord(UICoord)>

solution: make Allocator a typedef, we don't expect any further functionality
2018-01-13 00:20:01 +01:00
5dea8eea1f DockAccess: draft how the partial application-builder for the DSL might work
...but not yet able to get it to compile.
Problem seems to be the generic lambda, which is itself a template.
Thus we need a way to instantiate that template with the correct arguments
prior to binding it into a std::function

been there, seen that recently (-> TreeExplorer, the Expander had a similar problem)
2018-01-12 05:50:01 +01:00
ef74527f6b DOC: eliminate spurious mentions of tr1:: 2018-01-12 03:03:25 +01:00
7385b3f525 DockAccess: pick up planning where I left it last September (#1104)
...this was quite an extensive digression, which basically gave us
a solid foundation for topological addressing and pattern matching
within the "interface space"
2018-01-11 02:48:51 +01:00
7dd69003b5 Navigator: finish path matching resolver for UI coordinates (closes #1107) 2018-01-10 04:42:49 +01:00
722c49e5ff Navigator: finish coverage of path extension 2018-01-10 04:21:42 +01:00
2d66293c32 Navigator: test for path extension now basically working as intended 2018-01-09 02:12:00 +01:00
f10263c469 Navigator: fix insidious nesting error in test definition 2018-01-09 01:52:49 +01:00
ff24f81d3f Navigator: implement extension by (partial) UI-Coordinate spec
rationale: sometimes (likely this is even the standard case) we do not just
want to "extend", rather we want to extent at very specific levels.

This is easy to implement, based on the existing building blocks for path manipulation
2018-01-09 00:50:54 +01:00
55c196e5a2 Navigator: define test cases for path extension after coverage 2018-01-08 23:49:24 +01:00
d5209bfe1d Navigator: get the anchor() cases to work as intended 2018-01-07 07:20:41 +01:00
0daeb02e4a UI-Coordinates/Navigator: identify misconception in the Builder
the original construction works only as long as we stick to the "classical" Builder syntax,
i.e. use chained calls of the builder functions. But as soon as we just invoke
some builder function for sake of the side-effect on the data within the builder,
this data is destroyed and moved out into the value return type, which unfortunately
is being thrown away right afterwards.

Thus: either make a builder really sideeffect-free, i.e. do each mutation
on a new copy (which is kind of inefficient and counterfeits the whole idea)
or just accept the side-effect and return only a reference.
In this case, we can still return a rvalue-Reference, since at the end
we want to move the product of the build process out into the destination.

This works only due to the C++ concept of sequence points, which ensures
the original object stays alive during the whole evaluation of such a chained
builder expression.

NOTE: the TreeMutator (in namespace lib::diff) also uses a similar Builder construction,
but in *that* case we really build a new product in each step and thus *must*
return a value object, otherwise the reference would already be dangling the
moment we leave the builder function.
2018-01-07 05:26:16 +01:00
837aa81fc5 Navigator: cook up some interesting test cases for anchor mutation
...and yes,
even writing seemingly superfluous test cases will uncover yet another bug
2018-01-07 03:17:15 +01:00
2665ad5bf3 Navigator: supply another mutation operation to make anchorage explicit
...basically just a re-use of existing functionality.
Needs some test coverage though
2018-01-07 02:24:33 +01:00
c88747dc99 Navigator: cover selection from several possible solutions 2018-01-06 04:36:18 +01:00
7434212ecf UI-Coordinates: allow for noexcept move construction 2018-01-06 03:38:52 +01:00
e7ce82d17e Navigator: fix covering of an explicit UI-Coordinate
...especially to make the anchorage explicit
2018-01-06 03:32:42 +01:00
0ea5583b62 Navigator: explicitly reject solutions that did not bind all wildcards
...this makes most of the remaining test cases pass

only a plain anchor is not yet properly interpolated
2018-01-05 03:57:27 +01:00
d9db5f3917 Navigator: further unit tests for boundrary cases
NOTE not working yet; trailing wildcards not rejected
2018-01-05 02:14:22 +01:00
f4648c393f Navigator: unit test simple cases of coverage 2018-01-04 04:52:09 +01:00
2a87a80e33 Navigator: implement interpolation of missing anchor prefix 2018-01-04 03:56:41 +01:00
267c3f69ea Navigator: refactor algo core for improved match check
...also prerequisite to implement matching against window specs
2018-01-04 03:08:08 +01:00
f23b916f03 Navigator: rework and sharpen the API
- the default should be to look for total coverage
- the predicates should reflect the actual state of the path only
- the 'canXXX' predicates test for possible covering mutation
2018-01-03 02:46:12 +01:00
92084d10a1 Navigator: Algo now survives first unit test case... 2018-01-02 17:03:43 +01:00
65ff7371d4 Navigator: integrate and build the new coverage
search for partial coverage should work now
(but actually the program doesn't terminate...)
2018-01-02 14:40:13 +01:00
9d0186a8d6 Navigator: implement core of the matching algo 2018-01-02 14:03:04 +01:00
3598e07c59 Navigator: draft skeletton of the patch matching algo 2018-01-02 00:57:41 +01:00
416d6c7b01 TreeExplorer: delayed expansion implemented and unit test PASS 2018-01-01 18:23:04 +01:00
d2bbe9c61b TreeExplorer: define behaviour of new "delayed expansion" feature
...we need yet another feature to build the path matching for the Navigator
2018-01-01 17:43:49 +01:00
d5ae52e558 UI-Coordinates: design implementation of the patch matching algorithm
...which indicates that we need some additional functionality from TreeExplorer
2017-12-31 21:05:15 +01:00
1a6cac9d66 UI-Coordinates: fix potential segfault
...when truncating to a position within the inline part, yet behind the actual end
2017-12-27 01:57:15 +01:00
b8047b3310 Navigator: LocationQuery interface now finished. Demo implementation unit test PASS (closes #1108)
I set out to "discover" what operations we actually need on the LocationQuery
interface, in order to build a "coordinate resolver" on top. It seems like
this set of operations is clear by now.

It comes somewhat as a surprise that this API is so small. This became possible
through the idea of a ''child iterator'' with the additional ability to delve down and
expand one level of children of the current element. Such can be ''implemented''
by relying on techniques similar to the "Monads" from functional programming.

Let's see if this was a good choice. The price to pay is a high level of ''formal precision''
when dealing with the abstraction barrier. We need to stick strictly to the notion of a
''logical path'' into a tree-like topology, and we need to be strong enough never to
give in and indulge with "the concrete, tangible". The concrete reality of a tree
processing algorithm with memory management plus backtracking is just to complex
to be handled mentally. So either stick to the rules or get lost.
2017-12-26 14:58:30 +01:00
a8e16a0f28 Navigator: identify and fix the bug
...which was basically harmless, no fundamental problem,
just a simple logical error on my behalf (using the wrong
depth level)
2017-12-26 14:40:51 +01:00
798b70f7f4 Navigator: add direct test coverage for child expansion
...et voila, it's broken!!

expansion at Perspective level yields "NIL", while it should yield "perspective-A"
2017-12-26 05:07:35 +01:00
33ea1ebb79 Navigator: work around the clumsy design of IterExplorer (#1125)
yet some more trickery to get around this design problem.
I just do not want to rework IterSource right now, since this will be
a major change and require more careful consideration.

Thus introduce a workaround and mark it as future work

Using this implementation, "child expansion" should now be possible.
But we do not cover this directly in Unit test yet
2017-12-26 04:49:59 +01:00
c007fbda43 Navigator: res-structure inheritance chain to allow passing current position
we need to layer our Navigator implementation on top,
since this object needs to capture a reference to the "current position".

This is necessary to be able to derive the child position by extending
and then to form a child navigator -- which is the essence of
implementing expandChildren()
2017-12-26 04:28:02 +01:00
30a90166fb X-mas: switch demo-Child-Iterator to the new framework
...passes all the existing unit tests!
2017-12-24 23:30:22 +01:00