Skip to content

Implement next-gen inference engine #193

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
26 of 31 tasks
pokey opened this issue Aug 6, 2021 · 0 comments
Open
26 of 31 tasks

Implement next-gen inference engine #193

pokey opened this issue Aug 6, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@pokey
Copy link
Member

pokey commented Aug 6, 2021

The problem

The biggest issue is that "take every line air past bat" doesn't behave as expected today. We need to come up with a consistent and predictable inference rule to handle our new fully compositional modifiers

The idea

Ideally, any leading modifier should be associative. So eg saying "chuck funk air past bat" should be equivalent to saying "take air past bat", then "chuck funk".

Formally, let <A> be an action, <M> be a modifier, and <T> be a target. Then the following should be equivalent:

"<A> <M> <T>"

should be equivalent to

"take <T>" followed by "<A> <M>"

Note that this rule only applies if <T> doesn't contain any compound targets with modifiers on active or on list items after the first. Eg for "chuck funk air and line bat", we don't want associativity, because otherwise "line bat" would be expanded to containing function. This rule just applies as far right as possible until it hits a part of a compound target that has a modifier

Tests to add

Challenging cases / cases to think about

  • "clear line air slice bat" <=> "take air slice bat" then "clear line"
  • "clear string air slice bat" <=> "take air slice bat" then "clear string"
  • "take line air between bat" <=> "take air between bat" then "take line"
  • "take funk air between bat" <=> "take air between bat" then "take funk"
  • "take every line air past bat" <=> "take line air past bat" then "take every" (or instead "take air past bat" then "take every line"?)
  • "take every line air between bat" <=> "take line air between bat" then "take every"
  • "take every funk air past bat" <=> "take funk air past bat" then "take every" (or instead "take air past bat" then "take every funk"?)
  • "take every funk air between bat" <=> "take funk air between bat" then "take every"
  • "take line air past token bat"
  • "chuck funk air and bat and line cap" (first two should be funk)
  • "chuck funk air and bat and line cap past drum" (first two should be "funk", last two "line")
  • "paste after line air and block bat" (we prob want the latter to infer "after")
  • "paste after line air and block bat and before line cap" (we prob want the first two to infer "after")
  • "<action> line state air and funk bat" <=> "take state air and funk bat" then "<action> line"
  • "<action> line state air and just funk bat" <=> "<action> line state air" and "<action> funk bat"
  • "<action> every line state air and funk bat" <=> "take state air and funk bat" then "<action> every line"
  • Interaction with "past end of line", and "past end of its line" (see Add "its" modifier #736)
  • Interaction with "before" and "after"
  • Interaction with "first past third token", "first and third token", etc
  • Fix "head block line air" #789

Related issues

#708 creates "head" as a modifier on its own, rather than "head <scopeType>". Similarly, we shoudl think about whether "every", "first", "next", etc should exist on their own or be tied to a scope type, eg "every funk", etc

See also #735 (review)

Some notes

Note that a lot of the following should be handled using "its" (#736)

  • Test case src/test/suite/fixtures/recorded/compoundTargets/chuckLineRiskSliceMade.yml will probably need to change
  • “past end of ” is kinda like a modifier
  • “to end of ” is kinda like a modifier
  • Instead of applying “funk” to start and end of range, first form range then apply “funk”
  • Same with “every funk”
  • Heuristic should be that behaviour should be the same when we remove the modifier, switch action to take, then say “ this”
  • How do 1) and 2) interact with 5)?
  • "move every line funk air and bat and cap to end of class"
  • "move every line funk air and bat and cap to end of class drum"
  • "pre every line air and bat past end of funk"

Examples / diagrams

Image from iOS
cursorless engine 2 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant