Skip to content
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

Newline in pretty printing modules with namespaces #696

Open
MM45 opened this issue Jan 22, 2025 · 0 comments
Open

Newline in pretty printing modules with namespaces #696

MM45 opened this issue Jan 22, 2025 · 0 comments
Assignees

Comments

@MM45
Copy link
Contributor

MM45 commented Jan 22, 2025

See title. An a short example, consider the following

require import PROM.

clone FullRO as G.

print G.RO.

module Alias = G.RO.

print Alias.

Here, the (module part of the) first print statement gives:

* In [modules]:

module RO = {
  var m : (G.in_t, G.out_t) FMap.fmap
  
  proc init() : unit = {
    G.RO.m <- FMap.empty;
  }
  
  proc get(x : G.in_t) : G.out_t = {
    var r : G.out_t;
    
    r <$ G.dout x;
    if (x \notin G.RO.m) 
      G.RO.m.[x] <- r;
    
    return oget G.RO.m.[x];
  }
  
  proc set(x : G.in_t, y : G.out_t) : unit = {
    G.RO.m.[x] <- y;
  }
  
  proc rem(x : G.in_t) : unit = {
    G.RO.m <- FMap.rem G.RO.m x;
  }
  
  proc sample(x : G.in_t) : unit = {
    G.
    RO.get(x);
  }
  
  proc restrK() : (G.in_t, G.out_t) FMap.fmap = {
    return G.RO.m;
  }
}.

See the printing of G.RO.get(x) in the sample procedure.
Then, the second printing statement gives:

* In [modules]:

module Alias = G.
RO.
@strub strub self-assigned this Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants