qtil
advanced-security/qtil-swift 0.0.3
Search

Module Tp5::Project5

Project this tuple set to a new tuple set of 5 values per row, by using a set of projection functions.

Sibling module of ProjectRelate5 (which takes a set of “relations” instead of “functions”).

Each project function accepts the values of a tuple from this tuple set, and returns a new value, where the value returned by the nth function will become the nth column in the new tuple set.

For example, the following projection switches (first, last) names to (last, first) names.

predicate firstLast(string first, string last) { exists(Person p | ... ) }

import Tp2<string, string, firstLast/2>
  ::Project2<string, string,
      Tuples2<string, string>::getFirst/2,
      Tuples2<string, string>::getSecond/2>
  as LastFirst

// Selects ("Curie", "Maria"), ("Einstein", "Albert"), etc.
from string a, string b where LastFirst::tp(a, b) select a, b

Import path

import qtil.fn.generated.Tp

Predicates

Parameters