Skip to content

Commit 835fed1

Browse files
committed
cleaned up logging
1 parent 6f19230 commit 835fed1

File tree

1 file changed

+21
-22
lines changed

1 file changed

+21
-22
lines changed

electrum/src/main/java/edu/mit/csail/sdg/alloy4compiler/parser/Action2Alloy.java

+21-22
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
import edu.mit.csail.sdg.alloy4compiler.ast.ExprVar;
2828
import edu.mit.csail.sdg.alloy4compiler.ast.Sig;
2929
import edu.mit.csail.sdg.alloy4compiler.ast.VisitQuery;
30-
import edu.mit.csail.sdg.alloy4compiler.ast.Sig.SubsetSig;
3130
import edu.mit.csail.sdg.alloy4compiler.translator.ConvToConjunction;
3231

3332
// - create an abstract sig Action
@@ -61,10 +60,10 @@ public void expand(final A4Reporter rep, final CompModule root, LinkedHashMap<Si
6160

6261
// create the parent Action signature
6362
Sig action_sig = root.addSig("_Action", null, null, null, null, Attr.ABSTRACT, Attr.PRIVATE);
64-
System.out.println("Created sig "+action_sig.label+" with "+action_sig.attributes+".");
63+
// System.out.println("Created sig "+action_sig.label+" with "+action_sig.attributes+".");
6564
// create the Dummy argument signature
6665
Sig dummy_sig = root.addSig("_Dummy", null, null, null, null, Attr.ONE, Attr.PRIVATE);
67-
System.out.println("Created sig "+dummy_sig.label+" with "+dummy_sig.attributes+".");
66+
// System.out.println("Created sig "+dummy_sig.label+" with "+dummy_sig.attributes+".");
6867

6968
final ExprVar dummy_var = ExprVar.make(null, dummy_sig.label);
7069
final ExprVar action_var = ExprVar.make(null, action_sig.label);
@@ -84,7 +83,7 @@ public void expand(final A4Reporter rep, final CompModule root, LinkedHashMap<Si
8483
// define sig Arg as the sum of all argument types
8584
// TODO: avoid repeated arg types
8685
Sig arg_sig = root.addSig("_Arg", ExprVar.make(null,"="), args, null, null, Attr.PRIVATE, Attr.VARIABLE);
87-
System.out.println("Max args is "+max_args+", sig "+arg_sig.label+" defined = "+ ((SubsetSig) arg_sig).parents + " with "+arg_sig.attributes+".");
86+
// System.out.println("Max args is "+max_args+", sig "+arg_sig.label+" defined = "+ ((SubsetSig) arg_sig).parents + " with "+arg_sig.attributes+".");
8887

8988
final ExprVar arg_var = ExprVar.make(null, arg_sig.label);
9089

@@ -112,18 +111,18 @@ public void expand(final A4Reporter rep, final CompModule root, LinkedHashMap<Si
112111
ev_names.add(ExprVar.make(null, "_event"));
113112
Expr ev_expr = padded_act_types;
114113
Decl ev = new Decl(Pos.UNKNOWN, Pos.UNKNOWN, null, null, ev_names, ev_expr);
115-
System.out.println("Field "+ev_names.get(0)+ " defined with "+ ev_expr+".");
114+
// System.out.println("Field "+ev_names.get(0)+ " defined with "+ ev_expr+".");
116115

117116
List<Decl> fields = new ArrayList<Decl>();
118117
fields.add(ev);
119118
Sig e_sig = root.addSig("_E", null, null, fields, null, Attr.ONE, Attr.PRIVATE);
120-
System.out.println("Created sig "+e_sig.label+" with "+e_sig.attributes+".");
119+
// System.out.println("Created sig "+e_sig.label+" with "+e_sig.attributes+".");
121120

122121
final ExprVar e_var = ExprVar.make(null, e_sig.label);
123122

124123
Expr mult = e_var.join(ExprVar.make(null, "_event")).one().always();
125124
root.addFact(null, "_e_mult", mult);
126-
System.out.println("Added event multiplicity fact: "+mult+".");
125+
// System.out.println("Added event multiplicity fact: "+mult+".");
127126

128127

129128
// create the arguments for the fired predicate, action + args
@@ -151,9 +150,9 @@ public void expand(final A4Reporter rep, final CompModule root, LinkedHashMap<Si
151150
// create the fired predicate
152151
final String fired_name = "_fired";
153152
root.addFunc(null, null, fired_name, null, fired_args, null, fired_expr);
154-
System.out.print("Created predicate "+fired_name+" with ");
155-
for (Decl d : fired_args) System.out.print(d.names+":"+d.expr+" ");
156-
System.out.println("as "+fired_expr+".");
153+
// System.out.print("Created predicate "+fired_name+" with ");
154+
// for (Decl d : fired_args) System.out.print(d.names+":"+d.expr+" ");
155+
// System.out.println("as "+fired_expr+".");
157156

158157
final ExprVar fired_var = ExprVar.make(null, fired_name);
159158

@@ -187,14 +186,14 @@ public void expand(final A4Reporter rep, final CompModule root, LinkedHashMap<Si
187186
final String fire_fact_name = "_fire_"+act_name;
188187
root.addFact(null, fire_fact_name, fir);
189188

190-
System.out.println(act_name+" firing condition: "+ fir);
189+
// System.out.println(act_name+" firing condition: "+ fir);
191190
}
192191

193192
// create the fired predicates (free or fixed args) for each action
194193
for (String act_name : acts_args.keySet()) {
195194
List<Decl> decls = new ArrayList<Decl>(acts_args.get(act_name));
196-
System.out.print((decls.size()>0?"With":"Without")+" arguments ");
197-
for (Decl d : decls) System.out.print(d.names+":"+d.expr+" ");
195+
// System.out.print((decls.size()>0?"With":"Without")+" arguments ");
196+
// for (Decl d : decls) System.out.print(d.names+":"+d.expr+" ");
198197

199198
Expr v0 = fired_var;
200199
for (int i = 0; i < max_args; i ++) {
@@ -209,8 +208,8 @@ public void expand(final A4Reporter rep, final CompModule root, LinkedHashMap<Si
209208
root.addFunc(null, null, curPredName(act_name), null, null, null, v0);
210209
root.addFunc(null, null, act_name, null, null, null, v0);
211210
}
212-
System.out.println("defined predicate "+act_name+" with "+v0);
213-
System.out.println("defined predicate "+curPredName(act_name)+" with "+v0);
211+
// System.out.println("defined predicate "+act_name+" with "+v0);
212+
// System.out.println("defined predicate "+curPredName(act_name)+" with "+v0);
214213

215214
}
216215

@@ -236,7 +235,7 @@ public void expand(final A4Reporter rep, final CompModule root, LinkedHashMap<Si
236235
final String fc_name = "_fc";
237236
fc_body = fc_body.always();
238237
root.addFact(null, fc_name, fc_body);
239-
System.out.println("FC fact "+fc_name+" defined: "+fc_body);
238+
// System.out.println("FC fact "+fc_name+" defined: "+fc_body);
240239
}
241240

242241
/**
@@ -264,7 +263,7 @@ public void expandAction(CompModule root, Pos p, Pos isPrivate, String n, List<D
264263
// creates a singleton sig representing th action, extending Action
265264
List<ExprVar> sig_action = Util.asList(ExprVar.make(null, "_Action"));
266265
Sig sig_this = root.addSig(actSigName(n), ExprVar.make(null, "extends"), sig_action, null, null, Attr.ONE, Attr.PRIVATE);
267-
System.out.println("Created sig "+sig_this.label+" with "+sig_this.attributes+".");
266+
// System.out.println("Created sig "+sig_this.label+" with "+sig_this.attributes+".");
268267

269268
// stores the arguments of this action (needed generating the succeeding constraints depending on total arguments)
270269
if (decls == null) decls = new ArrayList<Decl>();
@@ -285,11 +284,11 @@ public void expandAction(CompModule root, Pos p, Pos isPrivate, String n, List<D
285284

286285
root.addFunc(p, isPrivate, prePredName(n), null, decls, null, ExprList.make(null, null, ExprList.Op.AND, v1));
287286
root.addFunc(p, isPrivate, postPredName(n), null, decls, null, ExprList.make(null, null, ExprList.Op.AND, v2));
288-
System.out.print((decls.size()>0?"With":"Without")+" arguments ");
289-
for (Decl d : decls) System.out.print(d.names+":"+d.expr+" ");
290-
System.out.println("defined:");
291-
System.out.println("predicate "+prePredName(n)+" with "+ExprList.make(null, null, ExprList.Op.AND, v1));
292-
System.out.println("predicate "+postPredName(n)+" with "+ExprList.make(null, null, ExprList.Op.AND, v2));
287+
// System.out.print((decls.size()>0?"With":"Without")+" arguments ");
288+
// for (Decl d : decls) System.out.print(d.names+":"+d.expr+" ");
289+
// System.out.println("defined:");
290+
// System.out.println("predicate "+prePredName(n)+" with "+ExprList.make(null, null, ExprList.Op.AND, v1));
291+
// System.out.println("predicate "+postPredName(n)+" with "+ExprList.make(null, null, ExprList.Op.AND, v2));
293292

294293
// store modified elements, cannot be expanded at this stage as it the modifies from other actions
295294
if (mods == null) mods = new ArrayList<ExprVar>();

0 commit comments

Comments
 (0)