Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tlc4b
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
general
stups
tlc4b
Commits
a4f6b584
Commit
a4f6b584
authored
11 years ago
by
hansen
Browse files
Options
Downloads
Patches
Plain Diff
added renamer to trace printer
parent
fc2af107
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/de/tlc4b/TLC4B.java
+1
-0
1 addition, 0 deletions
src/main/java/de/tlc4b/TLC4B.java
src/main/java/de/tlc4b/tlc/TracePrinter.java
+28
-15
28 additions, 15 deletions
src/main/java/de/tlc4b/tlc/TracePrinter.java
with
29 additions
and
15 deletions
src/main/java/de/tlc4b/TLC4B.java
+
1
−
0
View file @
a4f6b584
...
...
@@ -121,6 +121,7 @@ public class TLC4B {
tlc4b
.
printResults
(
results
,
false
);
//System.out.println(results.getTrace());
System
.
exit
(
0
);
}
}
...
...
This diff is collapsed.
Click to expand it.
src/main/java/de/tlc4b/tlc/TracePrinter.java
+
28
−
15
View file @
a4f6b584
...
...
@@ -49,24 +49,28 @@ public class TracePrinter {
this
.
trace
=
trace
;
this
.
tlcOutputInfo
=
tlcOutputInfo
;
setup
();
}
private
void
setup
()
{
constants
=
new
ArrayList
<
OpDeclNode
>();
variables
=
new
ArrayList
<
OpDeclNode
>();
for
(
int
i
=
0
;
i
<
TLCState
.
vars
.
length
;
i
++)
{
String
id
=
TLCState
.
vars
[
i
].
getName
().
toString
();
if
(
tlcOutputInfo
.
constants
.
contains
(
id
))
{
String
tlaName
=
TLCState
.
vars
[
i
].
getName
().
toString
();
String
bName
=
tlcOutputInfo
.
getBName
(
tlaName
);
if
(
tlcOutputInfo
.
constants
.
contains
(
bName
))
{
constants
.
add
(
TLCState
.
vars
[
i
]);
}
else
{
variables
.
add
(
TLCState
.
vars
[
i
]);
}
}
evalTrace
();
}
public
TracePrinter
(
TLCState
initialState
,
TLCOutputInfo
tlcOutputInfo
)
{
this
.
initialState
=
initialState
;
this
.
tlcOutputInfo
=
tlcOutputInfo
;
evalTrace
();
setup
();
}
public
StringBuilder
getTrace
()
{
...
...
@@ -103,10 +107,11 @@ public class TracePrinter {
expression
.
append
(
" & "
);
}
UniqueString
var
=
constants
.
get
(
i
).
getName
();
String
bName
=
tlcOutputInfo
.
getBName
(
var
.
toString
());
BType
type
=
tlcOutputInfo
.
getBType
(
var
.
toString
());
String
value
=
parseValue
(
state
.
lookup
(
var
),
type
)
.
toString
();
expression
.
append
(
var
).
append
(
" = "
).
append
(
value
);
expression
.
append
(
bName
).
append
(
" = "
).
append
(
value
);
}
}
expression
.
append
(
"\n"
);
...
...
@@ -122,9 +127,10 @@ public class TracePrinter {
expression
.
append
(
" & "
);
}
UniqueString
var
=
variables
.
get
(
i
).
getName
();
String
bName
=
tlcOutputInfo
.
getBName
(
var
.
toString
());
BType
type
=
tlcOutputInfo
.
getBType
(
var
.
toString
());
String
value
=
parseValue
(
state
.
lookup
(
var
),
type
).
toString
();
expression
.
append
(
var
).
append
(
" = "
).
append
(
value
);
expression
.
append
(
bName
).
append
(
" = "
).
append
(
value
);
}
return
expression
;
}
...
...
@@ -165,13 +171,20 @@ public class TracePrinter {
res
.
append
(
")"
);
return
res
;
}
else
if
(
type
instanceof
FunctionType
)
{
if
(((
TupleValue
)
val
).
elems
.
length
==
0
){
res
.
append
(
"{}"
);
return
res
;
}
else
{
BType
subtype
=
((
FunctionType
)
type
).
getRange
();
res
.
append
(
"["
);
System
.
out
.
println
();
res
.
append
(
parseEnumerationValue
(((
TupleValue
)
val
).
elems
,
subtype
));
res
.
append
(
"]"
);
return
res
;
}
}
return
null
;
case
RECORDVALUE:
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment