Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
ProB 2 Jupyter Kernel
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Insights
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
ProB 2 Jupyter Kernel
Commits
1c8f4ecb
Commit
1c8f4ecb
authored
5 years ago
by
dgelessus
Browse files
Options
Downloads
Patches
Plain Diff
Remove outdated note from :type command help
ProB now returns the types in B syntax rather than internal Prolog terms.
parent
bbc147f3
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
notebooks/tests/type.ipynb
+2
-6
2 additions, 6 deletions
notebooks/tests/type.ipynb
src/main/java/de/prob2/jupyter/commands/TypeCommand.java
+1
-1
1 addition, 1 deletion
src/main/java/de/prob2/jupyter/commands/TypeCommand.java
with
3 additions
and
7 deletions
notebooks/tests/type.ipynb
+
2
−
6
View file @
1c8f4ecb
...
...
@@ -12,15 +12,11 @@
":type FORMULA\n",
"```\n",
"\n",
"Display the type of a formula.\n",
"\n",
"The returned types are *not* standard B types. They are human-readable, but cannot be used in code."
"Display the type of a formula."
],
"text/plain": [
":type FORMULA\n",
"Display the type of a formula.\n",
"\n",
"The returned types are *not* standard B types. They are human-readable, but cannot be used in code."
"Display the type of a formula."
]
},
"execution_count": 1,
...
...
%% Cell type:code id: tags:
```
prob
:help :type
```
%% Output
```
:type FORMULA
```
Display the type of a formula.
The returned types are *not* standard B types. They are human-readable, but cannot be used in code.
:type FORMULA
Display the type of a formula.
The returned types are *not* standard B types. They are human-readable, but cannot be used in code.
%% Cell type:markdown id: tags:
`:type`
works on expressions.
%% Cell type:code id: tags:
```
prob
:type 1
```
%% Output
INTEGER
%% Cell type:code id: tags:
```
prob
:type {}
```
%% Output
POW(?)
%% Cell type:code id: tags:
```
prob
:type {1, 2, 3}
```
%% Output
POW(INTEGER)
%% Cell type:code id: tags:
```
prob
:type 1..5
```
%% Output
POW(INTEGER)
%% Cell type:code id: tags:
```
prob
:type [1, 2, 3]
```
%% Output
seq(INTEGER)
%% Cell type:code id: tags:
```
prob
:type {{(1, 2, 3), (4, 5, 6)}, {(7, 8, 9)}}
```
%% Output
POW(((INTEGER*INTEGER)<->INTEGER))
%% Cell type:markdown id: tags:
`:type`
works on predicates.
%% Cell type:code id: tags:
```
prob
:type 1 = 1
```
%% Output
predicate
%% Cell type:code id: tags:
```
prob
:type #x.(x : INT & x > 1)
```
%% Output
predicate
%% Cell type:markdown id: tags:
`:type`
displays type errors.
%% Cell type:code id: tags:
```
prob
:type {1, TRUE, "string", {}}
```
%% Output
Error from ProB: Type errors in formula
3 errors:
Error: Type mismatch: Expected INTEGER, but was BOOL in 'TRUE' (:1:4 to 1:8)
// Source code not known
Error: Type mismatch: Expected INTEGER, but was STRING in '"string"' (:1:10 to 1:18)
// Source code not known
Error: Type mismatch: Expected INTEGER, but was POW(_A) in '{}' (:1:20 to 1:22)
// Source code not known
%% Cell type:code id: tags:
```
prob
:type 1 + {}
```
%% Output
Error from ProB: Type errors in formula
Error: Type mismatch: Expected INTEGER, but was POW(_A) in '{}' (:1:4 to 1:6)
// Source code not known
%% Cell type:markdown id: tags:
Local variables can be passed to
`:type`
.
%% Cell type:code id: tags:
```
prob
:let thing {{(1, 2, 3), (4, 5, 6)}, {(7, 8, 9)}}
```
%% Output
$\{\{(1\mapsto 2\mapsto 3),(4\mapsto 5\mapsto 6)\},\{(7\mapsto 8\mapsto 9)\}\}$
{{(1↦2↦3),(4↦5↦6)},{(7↦8↦9)}}
%% Cell type:code id: tags:
```
prob
:type thing
```
%% Output
POW(((INTEGER*INTEGER)<->INTEGER))
%% Cell type:code id: tags:
```
prob
:type thing, 123
```
%% Output
POW(((INTEGER*INTEGER)<->INTEGER))*INTEGER
...
...
This diff is collapsed.
Click to expand it.
src/main/java/de/prob2/jupyter/commands/TypeCommand.java
+
1
−
1
View file @
1c8f4ecb
...
...
@@ -41,7 +41,7 @@ public final class TypeCommand implements Command {
@Override
public
@NotNull
String
getHelpBody
()
{
return
"
The returned types are *not* standard B types. They are human-readable, but cannot be used in code.
"
;
return
""
;
}
@Override
...
...
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