What language do these definitions use?


// A constraint set C:
C = true
  | C, (L1: L2) @ P    // Lifetime L1 outlives Lifetime L2 at point P

// A lifetime L:
L = 'a
  | {P}

What's the language used to represent the grammer?
Anyone can give some references or wikis?

I just can't understand meanings of true | , { }

| means "or". true means true? That is, "true" constraint is always satisfied. {P} is just a syntax. It means you can construct lifetime L from point P, and that lifetime is written {P}.

what does the , mean?
and 'a can also be {P}

It means that a constraint set is either true, or it is a (smaller) constraint set plus a constraint of the form "Lifetime L1 outlives Lifetime L2 at point P".

The second part means that a lifetime can either be a named lifetime 'some_name, or it can be a location in the control flow graph, written as {P} for P being the location.


so, what's the special language? any artical?

Uhh, not sure what it's called.

all right...

It's just an ad-hoc syntax to define the grammar used to describe constraint sets. Something akin to BNF maybe.


This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.