--- layout: default title: "Generating" parent: Normal ancestor: Funcons-beta --- [Funcons-beta] : [Generating.cbs] ----------------------------- ### Generating
[
  Type   atoms
  Entity used-atom-set
  Funcon initialise-generating
  Funcon fresh-atom
  Funcon use-atom-not-in
]
Meta-variables
  T <: values
Built-in Type
  atoms
atoms is the type of values used as distinguishable tags. Notation for individual atoms is not provided.
Entity
  < _ , used-atom-set(_:sets(atoms)) > ---> < _ , used-atom-set(_:sets(atoms)) >
Built-in Funcon
  initialise-generating(_:=>T) : =>T
The initial value of the used-atom-set(SA) entity is unspecified. It could contains atoms that are reserved for internal use.
Funcon
  fresh-atom : =>atoms
fresh-atom computes an atom distinct from all previously computed atoms.
Rule
  element-not-in(atoms, SA) ~> A
  -----------------------------------------------
  < fresh-atom , used-atom-set(SA) > 
    ---> < A , used-atom-set(set-insert(A, SA)) >
Funcon
  use-atom-not-in(_:sets(atoms)) : =>atoms
use-atom-not-in(SA) computes an atom not in the set SA, and inserts it in the used-atom-set(SA′) entity, in case it was not previously used.
Rule
  element-not-in(atoms, SA) ~> A
  --------------------------------------------------------
  < use-atom-not-in(SA:sets(atoms)) , used-atom-set(SA′) >
    ---> < A , used-atom-set(set-insert(A, SA′)) >
____ From the [PLanCompS Project] | [CBS-beta issues...] | [Suggest an improvement...] [Generating.cbs]: Generating.cbs "CBS SOURCE FILE" [Funcons-beta]: /CBS-beta/docs/Funcons-beta "FUNCONS-BETA" [Unstable-Funcons-beta]: /CBS-beta/docs/Unstable-Funcons-beta "UNSTABLE-FUNCONS-BETA" [Languages-beta]: /CBS-beta/docs/Languages-beta "LANGUAGES-BETA" [Unstable-Languages-beta]: /CBS-beta/docs/Unstable-Languages-beta "UNSTABLE-LANGUAGES-BETA" [CBS-beta]: /CBS-beta "CBS-BETA" [PLanCompS Project]: https://plancomps.github.io "PROGRAMMING LANGUAGE COMPONENTS AND SPECIFICATIONS PROJECT HOME PAGE" [CBS-beta issues...]: https://github.com/plancomps/CBS-beta/issues "CBS-BETA ISSUE REPORTS ON GITHUB" [Suggest an improvement...]: mailto:plancomps@gmail.com?Subject=CBS-beta%20-%20comment&Body=Re%3A%20CBS-beta%20specification%20at%20Computations/Normal/Generating/Generating.cbs%0A%0AComment/Query/Issue/Suggestion%3A%0A%0A%0ASignature%3A%0A "GENERATE AN EMAIL TEMPLATE"