RascalTutor

This is a test synopsis.

Description

See examples below.

Examples

  • emphasis

  • bold

  • [Rascal Web site](http:///rascal-mpl.org)

  • [CallAnalysis]()

  • Table:

    | Module | LOC |
    |--------|-----|
    | A      | 10 |
    | B      | 20 |

| Operator | Description | |------------|------------| | $A$ \| $B$ | alternative | | \|\| | or |

Horizontal rule:


  • code

  • in code: italics

<toc Test 2>

Benefits

Pitfalls

1. Synopsis

Analyzing the call structure of an application.

2. Description

Suppose a mystery box ends up on your desk. When you open it, it contains a huge software system with several questions attached to it:

  • How many procedure calls occur in this system?

  • How many procedures does it contains?

  • What are the entry points for this system, i.e., procedures that call others but are not called themselves?

  • What are the leaves of this application, i.e., procedures that are called but do not make any calls themselves?

  • Which procedures call each other indirectly?

  • Which procedures are called directly or indirectly from each entry point?

  • Which procedures are called from all entry points?

Let’s see how these questions can be answered using Rascal.

Examples: Consider the following call graph (a box represents a procedure and an arrow represents a call from one procedure to another procedure):

![calls](calls.png)

Rascal supports basic data types like integers and strings which are sufficient to formulate and answer the questions at hand. However, we can gain readability by introducing separately named types for the items we are describing. First, we introduce therefore a new type Proc (an alias for strings) to denote procedures:

rascal>alias Proc = str;
[red]##Error: Not supported construct: alias Proc = str;##

Next, we have to represent the call relation as a Rascal datatype, and the relation is the most appropriate for it. As preparation, we also import the libraries [$Rascal:Prelude/Set], [$Rascal:Prelude/Relation] and [$Rascal:Prelude/Graph] that will come in handy.

rascal>import Set;
An unexpected internal error occurred:
java.lang.RuntimeException: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: Exception in CALLJAVA: org.rascalmpl.library.PreludeCompiled.remove; message: could not call Java method removejava.lang.IllegalArgumentException: java.lang.ClassCastException@2fd253cf
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.executeRVMFunction(RVMonJVM.java:193)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMJVM.executeRVMFunction(RVMJVM.java:127)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.executeRVMFunction(RVMCore.java:460)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.java2rascal.RascalFunctionInvocationHandler.invoke(RascalFunctionInvocationHandler.java:85)
	at com.sun.proxy.$Proxy2.compileAndMergeProgramIncremental(Unknown Source)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.executeModule(CommandExecutor.java:361)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.evalImport(CommandExecutor.java:720)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.eval(CommandExecutor.java:444)
	at org.rascalmpl.library.experiments.tutor3.TutorCommandExecutor.evalPrint(TutorCommandExecutor.java:75)
	at org.rascalmpl.library.experiments.tutor3.Concept.preprocess(Concept.java:264)
	at org.rascalmpl.library.experiments.tutor3.Onthology.<init>(Onthology.java:131)
	at org.rascalmpl.library.experiments.tutor3.CourseCompiler.compileCourse(CourseCompiler.java:92)
	at org.rascalmpl.library.experiments.tutor3.CourseCompiler.main(CourseCompiler.java:271)
Caused by: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: Exception in CALLJAVA: org.rascalmpl.library.PreludeCompiled.remove; message: could not call Java method removejava.lang.IllegalArgumentException: java.lang.ClassCastException@2fd253cf
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.insnCALLJAVA(RVMonJVM.java:454)
	at lang.rascal.boot.Kernel$Compiled.IO\remove(\loc():)#618(Unknown Source)
	at lang.rascal.boot.Kernel$Compiled.experiments::Compiler::Execute\compileAndMergeProgramIncremental(str():bool():adt("PathConfig",()):)#562(Unknown Source)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.executeRVMFunction(RVMonJVM.java:187)
	... 12 more
Caused by: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: could not call Java method remove
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.callJavaMethod(RVMCore.java:1126)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.insnCALLJAVA(RVMonJVM.java:443)
	... 15 more
Caused by: java.lang.IllegalArgumentException: java.lang.ClassCastException@2fd253cf
	at sun.reflect.GeneratedMethodAccessor35.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.callJavaMethod(RVMCore.java:1122)
	... 16 more
rascal>import Relation;
An unexpected internal error occurred:
java.lang.RuntimeException: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: Exception in CALLJAVA: org.rascalmpl.library.PreludeCompiled.remove; message: could not call Java method removejava.lang.IllegalArgumentException: java.lang.ClassCastException@41412e5d
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.executeRVMFunction(RVMonJVM.java:193)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMJVM.executeRVMFunction(RVMJVM.java:127)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.executeRVMFunction(RVMCore.java:460)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.java2rascal.RascalFunctionInvocationHandler.invoke(RascalFunctionInvocationHandler.java:85)
	at com.sun.proxy.$Proxy2.compileAndMergeProgramIncremental(Unknown Source)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.executeModule(CommandExecutor.java:361)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.evalImport(CommandExecutor.java:720)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.eval(CommandExecutor.java:444)
	at org.rascalmpl.library.experiments.tutor3.TutorCommandExecutor.evalPrint(TutorCommandExecutor.java:75)
	at org.rascalmpl.library.experiments.tutor3.Concept.preprocess(Concept.java:264)
	at org.rascalmpl.library.experiments.tutor3.Onthology.<init>(Onthology.java:131)
	at org.rascalmpl.library.experiments.tutor3.CourseCompiler.compileCourse(CourseCompiler.java:92)
	at org.rascalmpl.library.experiments.tutor3.CourseCompiler.main(CourseCompiler.java:271)
Caused by: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: Exception in CALLJAVA: org.rascalmpl.library.PreludeCompiled.remove; message: could not call Java method removejava.lang.IllegalArgumentException: java.lang.ClassCastException@41412e5d
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.insnCALLJAVA(RVMonJVM.java:454)
	at lang.rascal.boot.Kernel$Compiled.IO\remove(\loc():)#618(Unknown Source)
	at lang.rascal.boot.Kernel$Compiled.experiments::Compiler::Execute\compileAndMergeProgramIncremental(str():bool():adt("PathConfig",()):)#562(Unknown Source)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.executeRVMFunction(RVMonJVM.java:187)
	... 12 more
Caused by: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: could not call Java method remove
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.callJavaMethod(RVMCore.java:1126)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.insnCALLJAVA(RVMonJVM.java:443)
	... 15 more
Caused by: java.lang.IllegalArgumentException: java.lang.ClassCastException@41412e5d
	at sun.reflect.GeneratedMethodAccessor35.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.callJavaMethod(RVMCore.java:1122)
	... 16 more
rascal>import analysis::graphs::Graph;
An unexpected internal error occurred:
java.lang.RuntimeException: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: Exception in CALLJAVA: org.rascalmpl.library.PreludeCompiled.remove; message: could not call Java method removejava.lang.IllegalArgumentException: java.lang.ClassCastException@b41c064
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.executeRVMFunction(RVMonJVM.java:193)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMJVM.executeRVMFunction(RVMJVM.java:127)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.executeRVMFunction(RVMCore.java:460)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.java2rascal.RascalFunctionInvocationHandler.invoke(RascalFunctionInvocationHandler.java:85)
	at com.sun.proxy.$Proxy2.compileAndMergeProgramIncremental(Unknown Source)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.executeModule(CommandExecutor.java:361)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.evalImport(CommandExecutor.java:720)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.eval(CommandExecutor.java:444)
	at org.rascalmpl.library.experiments.tutor3.TutorCommandExecutor.evalPrint(TutorCommandExecutor.java:75)
	at org.rascalmpl.library.experiments.tutor3.Concept.preprocess(Concept.java:264)
	at org.rascalmpl.library.experiments.tutor3.Onthology.<init>(Onthology.java:131)
	at org.rascalmpl.library.experiments.tutor3.CourseCompiler.compileCourse(CourseCompiler.java:92)
	at org.rascalmpl.library.experiments.tutor3.CourseCompiler.main(CourseCompiler.java:271)
Caused by: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: Exception in CALLJAVA: org.rascalmpl.library.PreludeCompiled.remove; message: could not call Java method removejava.lang.IllegalArgumentException: java.lang.ClassCastException@b41c064
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.insnCALLJAVA(RVMonJVM.java:454)
	at lang.rascal.boot.Kernel$Compiled.IO\remove(\loc():)#618(Unknown Source)
	at lang.rascal.boot.Kernel$Compiled.experiments::Compiler::Execute\compileAndMergeProgramIncremental(str():bool():adt("PathConfig",()):)#562(Unknown Source)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.executeRVMFunction(RVMonJVM.java:187)
	... 12 more
Caused by: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: could not call Java method remove
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.callJavaMethod(RVMCore.java:1126)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.insnCALLJAVA(RVMonJVM.java:443)
	... 15 more
Caused by: java.lang.IllegalArgumentException: java.lang.ClassCastException@b41c064
	at sun.reflect.GeneratedMethodAccessor35.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.callJavaMethod(RVMCore.java:1122)
	... 16 more
rascal>rel[Proc, Proc] Calls = {<"a", "b">, <"b", "c">, <"b", "d">, <"d", "c">, <"d", "e">, <"f", "e">, <"f", "g">, <"g", "e">};
An unexpected internal error occurred:
java.lang.RuntimeException: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: Exception in CALLJAVA: org.rascalmpl.library.PreludeCompiled.remove; message: could not call Java method removejava.lang.IllegalArgumentException: java.lang.ClassCastException@686a4c35
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.executeRVMFunction(RVMonJVM.java:193)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMJVM.executeRVMFunction(RVMJVM.java:127)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.executeRVMFunction(RVMCore.java:460)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.java2rascal.RascalFunctionInvocationHandler.invoke(RascalFunctionInvocationHandler.java:85)
	at com.sun.proxy.$Proxy2.compileAndMergeProgramIncremental(Unknown Source)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.executeModule(CommandExecutor.java:361)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.evalDeclaration(CommandExecutor.java:641)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.eval(CommandExecutor.java:447)
	at org.rascalmpl.library.experiments.tutor3.TutorCommandExecutor.evalPrint(TutorCommandExecutor.java:75)
	at org.rascalmpl.library.experiments.tutor3.Concept.preprocess(Concept.java:264)
	at org.rascalmpl.library.experiments.tutor3.Onthology.<init>(Onthology.java:131)
	at org.rascalmpl.library.experiments.tutor3.CourseCompiler.compileCourse(CourseCompiler.java:92)
	at org.rascalmpl.library.experiments.tutor3.CourseCompiler.main(CourseCompiler.java:271)
Caused by: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: Exception in CALLJAVA: org.rascalmpl.library.PreludeCompiled.remove; message: could not call Java method removejava.lang.IllegalArgumentException: java.lang.ClassCastException@686a4c35
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.insnCALLJAVA(RVMonJVM.java:454)
	at lang.rascal.boot.Kernel$Compiled.IO\remove(\loc():)#618(Unknown Source)
	at lang.rascal.boot.Kernel$Compiled.experiments::Compiler::Execute\compileAndMergeProgramIncremental(str():bool():adt("PathConfig",()):)#562(Unknown Source)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.executeRVMFunction(RVMonJVM.java:187)
	... 12 more
Caused by: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: could not call Java method remove
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.callJavaMethod(RVMCore.java:1126)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.insnCALLJAVA(RVMonJVM.java:443)
	... 15 more
Caused by: java.lang.IllegalArgumentException: java.lang.ClassCastException@686a4c35
	at sun.reflect.GeneratedMethodAccessor35.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.callJavaMethod(RVMCore.java:1122)
	... 16 more

Now we are in a good position to start asking some questions.

How many calls occur in this system? We use the function [Rascal:Set/size] to determine the number of elements in a set or relation. Since each tuple in the Calls relation represents a call between procedures, the number of tuples is equal to the number of calls.

rascal>size(Calls);
An unexpected internal error occurred:
java.lang.RuntimeException: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: Exception in CALLJAVA: org.rascalmpl.library.PreludeCompiled.remove; message: could not call Java method removejava.lang.IllegalArgumentException: java.lang.ClassCastException@7b70d959
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.executeRVMFunction(RVMonJVM.java:193)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMJVM.executeRVMFunction(RVMJVM.java:127)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.executeRVMFunction(RVMCore.java:460)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.java2rascal.RascalFunctionInvocationHandler.invoke(RascalFunctionInvocationHandler.java:85)
	at com.sun.proxy.$Proxy2.compileAndMergeProgramIncremental(Unknown Source)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.executeModule(CommandExecutor.java:361)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.evalStatement(CommandExecutor.java:520)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.eval(CommandExecutor.java:441)
	at org.rascalmpl.library.experiments.tutor3.TutorCommandExecutor.evalPrint(TutorCommandExecutor.java:75)
	at org.rascalmpl.library.experiments.tutor3.Concept.preprocess(Concept.java:264)
	at org.rascalmpl.library.experiments.tutor3.Onthology.<init>(Onthology.java:131)
	at org.rascalmpl.library.experiments.tutor3.CourseCompiler.compileCourse(CourseCompiler.java:92)
	at org.rascalmpl.library.experiments.tutor3.CourseCompiler.main(CourseCompiler.java:271)
Caused by: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: Exception in CALLJAVA: org.rascalmpl.library.PreludeCompiled.remove; message: could not call Java method removejava.lang.IllegalArgumentException: java.lang.ClassCastException@7b70d959
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.insnCALLJAVA(RVMonJVM.java:454)
	at lang.rascal.boot.Kernel$Compiled.IO\remove(\loc():)#618(Unknown Source)
	at lang.rascal.boot.Kernel$Compiled.experiments::Compiler::Execute\compileAndMergeProgramIncremental(str():bool():adt("PathConfig",()):)#562(Unknown Source)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.executeRVMFunction(RVMonJVM.java:187)
	... 12 more
Caused by: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: could not call Java method remove
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.callJavaMethod(RVMCore.java:1126)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.insnCALLJAVA(RVMonJVM.java:443)
	... 15 more
Caused by: java.lang.IllegalArgumentException: java.lang.ClassCastException@7b70d959
	at sun.reflect.GeneratedMethodAccessor35.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.callJavaMethod(RVMCore.java:1122)
	... 16 more

How many procedures occur in this system? This question is more subtle, since a procedure may call (or be called) by several others and the number of tuples is therefore not indicative. What we need are the set of procedures that occur (as first or second element) in any tuple. This is precisely what the function [$Rascal:carrier] gives us:

rascal>carrier(Calls)
An unexpected internal error occurred:
java.lang.RuntimeException: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: Exception in CALLJAVA: org.rascalmpl.library.PreludeCompiled.remove; message: could not call Java method removejava.lang.IllegalArgumentException: java.lang.ClassCastException@5ffc190
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.executeRVMFunction(RVMonJVM.java:193)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMJVM.executeRVMFunction(RVMJVM.java:127)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.executeRVMFunction(RVMCore.java:460)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.java2rascal.RascalFunctionInvocationHandler.invoke(RascalFunctionInvocationHandler.java:85)
	at com.sun.proxy.$Proxy2.compileAndMergeProgramIncremental(Unknown Source)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.executeModule(CommandExecutor.java:361)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.evalExpression(CommandExecutor.java:453)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.eval(CommandExecutor.java:438)
	at org.rascalmpl.library.experiments.tutor3.TutorCommandExecutor.evalPrint(TutorCommandExecutor.java:75)
	at org.rascalmpl.library.experiments.tutor3.Concept.preprocess(Concept.java:264)
	at org.rascalmpl.library.experiments.tutor3.Onthology.<init>(Onthology.java:131)
	at org.rascalmpl.library.experiments.tutor3.CourseCompiler.compileCourse(CourseCompiler.java:92)
	at org.rascalmpl.library.experiments.tutor3.CourseCompiler.main(CourseCompiler.java:271)
Caused by: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: Exception in CALLJAVA: org.rascalmpl.library.PreludeCompiled.remove; message: could not call Java method removejava.lang.IllegalArgumentException: java.lang.ClassCastException@5ffc190
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.insnCALLJAVA(RVMonJVM.java:454)
	at lang.rascal.boot.Kernel$Compiled.IO\remove(\loc():)#618(Unknown Source)
	at lang.rascal.boot.Kernel$Compiled.experiments::Compiler::Execute\compileAndMergeProgramIncremental(str():bool():adt("PathConfig",()):)#562(Unknown Source)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.executeRVMFunction(RVMonJVM.java:187)
	... 12 more
Caused by: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: could not call Java method remove
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.callJavaMethod(RVMCore.java:1126)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.insnCALLJAVA(RVMonJVM.java:443)
	... 15 more
Caused by: java.lang.IllegalArgumentException: java.lang.ClassCastException@5ffc190
	at sun.reflect.GeneratedMethodAccessor35.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.callJavaMethod(RVMCore.java:1122)
	... 16 more

and computing the number of procedures is now easy:

rascal>size(carrier(Calls));
An unexpected internal error occurred:
java.lang.RuntimeException: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: Exception in CALLJAVA: org.rascalmpl.library.PreludeCompiled.remove; message: could not call Java method removejava.lang.IllegalArgumentException: java.lang.ClassCastException@11a752ee
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.executeRVMFunction(RVMonJVM.java:193)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMJVM.executeRVMFunction(RVMJVM.java:127)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.executeRVMFunction(RVMCore.java:460)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.java2rascal.RascalFunctionInvocationHandler.invoke(RascalFunctionInvocationHandler.java:85)
	at com.sun.proxy.$Proxy2.compileAndMergeProgramIncremental(Unknown Source)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.executeModule(CommandExecutor.java:361)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.evalStatement(CommandExecutor.java:520)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.eval(CommandExecutor.java:441)
	at org.rascalmpl.library.experiments.tutor3.TutorCommandExecutor.evalPrint(TutorCommandExecutor.java:75)
	at org.rascalmpl.library.experiments.tutor3.Concept.preprocess(Concept.java:264)
	at org.rascalmpl.library.experiments.tutor3.Onthology.<init>(Onthology.java:131)
	at org.rascalmpl.library.experiments.tutor3.CourseCompiler.compileCourse(CourseCompiler.java:92)
	at org.rascalmpl.library.experiments.tutor3.CourseCompiler.main(CourseCompiler.java:271)
Caused by: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: Exception in CALLJAVA: org.rascalmpl.library.PreludeCompiled.remove; message: could not call Java method removejava.lang.IllegalArgumentException: java.lang.ClassCastException@11a752ee
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.insnCALLJAVA(RVMonJVM.java:454)
	at lang.rascal.boot.Kernel$Compiled.IO\remove(\loc():)#618(Unknown Source)
	at lang.rascal.boot.Kernel$Compiled.experiments::Compiler::Execute\compileAndMergeProgramIncremental(str():bool():adt("PathConfig",()):)#562(Unknown Source)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.executeRVMFunction(RVMonJVM.java:187)
	... 12 more
Caused by: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: could not call Java method remove
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.callJavaMethod(RVMCore.java:1126)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.insnCALLJAVA(RVMonJVM.java:443)
	... 15 more
Caused by: java.lang.IllegalArgumentException: java.lang.ClassCastException@11a752ee
	at sun.reflect.GeneratedMethodAccessor35.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.callJavaMethod(RVMCore.java:1122)
	... 16 more

As an aside, functions [$Rascal:Prelude/Relation/domain] and [$Rascal:Prelude/Relation/range] do the same for the first, respectively, second element of the pairs in a relation:

rascal>domain(Calls);
An unexpected internal error occurred:
java.lang.RuntimeException: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: Exception in CALLJAVA: org.rascalmpl.library.PreludeCompiled.remove; message: could not call Java method removejava.lang.IllegalArgumentException: java.lang.ClassCastException@16bcf81a
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.executeRVMFunction(RVMonJVM.java:193)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMJVM.executeRVMFunction(RVMJVM.java:127)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.executeRVMFunction(RVMCore.java:460)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.java2rascal.RascalFunctionInvocationHandler.invoke(RascalFunctionInvocationHandler.java:85)
	at com.sun.proxy.$Proxy2.compileAndMergeProgramIncremental(Unknown Source)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.executeModule(CommandExecutor.java:361)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.evalStatement(CommandExecutor.java:520)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.eval(CommandExecutor.java:441)
	at org.rascalmpl.library.experiments.tutor3.TutorCommandExecutor.evalPrint(TutorCommandExecutor.java:75)
	at org.rascalmpl.library.experiments.tutor3.Concept.preprocess(Concept.java:264)
	at org.rascalmpl.library.experiments.tutor3.Onthology.<init>(Onthology.java:131)
	at org.rascalmpl.library.experiments.tutor3.CourseCompiler.compileCourse(CourseCompiler.java:92)
	at org.rascalmpl.library.experiments.tutor3.CourseCompiler.main(CourseCompiler.java:271)
Caused by: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: Exception in CALLJAVA: org.rascalmpl.library.PreludeCompiled.remove; message: could not call Java method removejava.lang.IllegalArgumentException: java.lang.ClassCastException@16bcf81a
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.insnCALLJAVA(RVMonJVM.java:454)
	at lang.rascal.boot.Kernel$Compiled.IO\remove(\loc():)#618(Unknown Source)
	at lang.rascal.boot.Kernel$Compiled.experiments::Compiler::Execute\compileAndMergeProgramIncremental(str():bool():adt("PathConfig",()):)#562(Unknown Source)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.executeRVMFunction(RVMonJVM.java:187)
	... 12 more
Caused by: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: could not call Java method remove
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.callJavaMethod(RVMCore.java:1126)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.insnCALLJAVA(RVMonJVM.java:443)
	... 15 more
Caused by: java.lang.IllegalArgumentException: java.lang.ClassCastException@16bcf81a
	at sun.reflect.GeneratedMethodAccessor35.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.callJavaMethod(RVMCore.java:1122)
	... 16 more
rascal>range(Calls);
An unexpected internal error occurred:
java.lang.RuntimeException: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: Exception in CALLJAVA: org.rascalmpl.library.PreludeCompiled.remove; message: could not call Java method removejava.lang.IllegalArgumentException: java.lang.ClassCastException@5de97e65
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.executeRVMFunction(RVMonJVM.java:193)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMJVM.executeRVMFunction(RVMJVM.java:127)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.executeRVMFunction(RVMCore.java:460)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.java2rascal.RascalFunctionInvocationHandler.invoke(RascalFunctionInvocationHandler.java:85)
	at com.sun.proxy.$Proxy2.compileAndMergeProgramIncremental(Unknown Source)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.executeModule(CommandExecutor.java:361)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.evalStatement(CommandExecutor.java:520)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.eval(CommandExecutor.java:441)
	at org.rascalmpl.library.experiments.tutor3.TutorCommandExecutor.evalPrint(TutorCommandExecutor.java:75)
	at org.rascalmpl.library.experiments.tutor3.Concept.preprocess(Concept.java:264)
	at org.rascalmpl.library.experiments.tutor3.Onthology.<init>(Onthology.java:131)
	at org.rascalmpl.library.experiments.tutor3.CourseCompiler.compileCourse(CourseCompiler.java:92)
	at org.rascalmpl.library.experiments.tutor3.CourseCompiler.main(CourseCompiler.java:271)
Caused by: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: Exception in CALLJAVA: org.rascalmpl.library.PreludeCompiled.remove; message: could not call Java method removejava.lang.IllegalArgumentException: java.lang.ClassCastException@5de97e65
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.insnCALLJAVA(RVMonJVM.java:454)
	at lang.rascal.boot.Kernel$Compiled.IO\remove(\loc():)#618(Unknown Source)
	at lang.rascal.boot.Kernel$Compiled.experiments::Compiler::Execute\compileAndMergeProgramIncremental(str():bool():adt("PathConfig",()):)#562(Unknown Source)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.executeRVMFunction(RVMonJVM.java:187)
	... 12 more
Caused by: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: could not call Java method remove
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.callJavaMethod(RVMCore.java:1126)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.insnCALLJAVA(RVMonJVM.java:443)
	... 15 more
Caused by: java.lang.IllegalArgumentException: java.lang.ClassCastException@5de97e65
	at sun.reflect.GeneratedMethodAccessor35.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.callJavaMethod(RVMCore.java:1122)
	... 16 more

What are the entry points for this system? The next step in the analysis is to determine which entry points this application has, i.e., procedures which call others but are not called themselves. Entry points are useful since they define the external interface of a system and may also be used as guidance to split a system in parts. The top of a relation contains those left-hand sides of tuples in a relation that do not occur in any right-hand side. When a relation is viewed as a graph, its top corresponds to the root nodes of that graph. Similarly, the bottom of a relation corresponds to the leaf nodes of the graph. See the section called ?Graph? for more details. Using this knowledge, the entry points can be computed by determining the top of the Calls relation:

rascal>top(Calls);
An unexpected internal error occurred:
java.lang.RuntimeException: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: Exception in CALLJAVA: org.rascalmpl.library.PreludeCompiled.remove; message: could not call Java method removejava.lang.IllegalArgumentException: java.lang.ClassCastException@1e3b1438
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.executeRVMFunction(RVMonJVM.java:193)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMJVM.executeRVMFunction(RVMJVM.java:127)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.executeRVMFunction(RVMCore.java:460)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.java2rascal.RascalFunctionInvocationHandler.invoke(RascalFunctionInvocationHandler.java:85)
	at com.sun.proxy.$Proxy2.compileAndMergeProgramIncremental(Unknown Source)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.executeModule(CommandExecutor.java:361)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.evalStatement(CommandExecutor.java:520)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.eval(CommandExecutor.java:441)
	at org.rascalmpl.library.experiments.tutor3.TutorCommandExecutor.evalPrint(TutorCommandExecutor.java:75)
	at org.rascalmpl.library.experiments.tutor3.Concept.preprocess(Concept.java:264)
	at org.rascalmpl.library.experiments.tutor3.Onthology.<init>(Onthology.java:131)
	at org.rascalmpl.library.experiments.tutor3.CourseCompiler.compileCourse(CourseCompiler.java:92)
	at org.rascalmpl.library.experiments.tutor3.CourseCompiler.main(CourseCompiler.java:271)
Caused by: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: Exception in CALLJAVA: org.rascalmpl.library.PreludeCompiled.remove; message: could not call Java method removejava.lang.IllegalArgumentException: java.lang.ClassCastException@1e3b1438
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.insnCALLJAVA(RVMonJVM.java:454)
	at lang.rascal.boot.Kernel$Compiled.IO\remove(\loc():)#618(Unknown Source)
	at lang.rascal.boot.Kernel$Compiled.experiments::Compiler::Execute\compileAndMergeProgramIncremental(str():bool():adt("PathConfig",()):)#562(Unknown Source)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.executeRVMFunction(RVMonJVM.java:187)
	... 12 more
Caused by: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: could not call Java method remove
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.callJavaMethod(RVMCore.java:1126)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.insnCALLJAVA(RVMonJVM.java:443)
	... 15 more
Caused by: java.lang.IllegalArgumentException: java.lang.ClassCastException@1e3b1438
	at sun.reflect.GeneratedMethodAccessor35.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.callJavaMethod(RVMCore.java:1122)
	... 16 more

What are the leaves of this application?

In a similar spirit, we can determine the leaves of this application, i.e., procedures that are being called but do not make any calls themselves:

rascal>bottom(Calls);
An unexpected internal error occurred:
java.lang.RuntimeException: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: Exception in CALLJAVA: org.rascalmpl.library.PreludeCompiled.remove; message: could not call Java method removejava.lang.IllegalArgumentException: java.lang.ClassCastException@72dc7ea1
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.executeRVMFunction(RVMonJVM.java:193)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMJVM.executeRVMFunction(RVMJVM.java:127)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.executeRVMFunction(RVMCore.java:460)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.java2rascal.RascalFunctionInvocationHandler.invoke(RascalFunctionInvocationHandler.java:85)
	at com.sun.proxy.$Proxy2.compileAndMergeProgramIncremental(Unknown Source)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.executeModule(CommandExecutor.java:361)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.evalStatement(CommandExecutor.java:520)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.eval(CommandExecutor.java:441)
	at org.rascalmpl.library.experiments.tutor3.TutorCommandExecutor.evalPrint(TutorCommandExecutor.java:75)
	at org.rascalmpl.library.experiments.tutor3.Concept.preprocess(Concept.java:264)
	at org.rascalmpl.library.experiments.tutor3.Onthology.<init>(Onthology.java:131)
	at org.rascalmpl.library.experiments.tutor3.CourseCompiler.compileCourse(CourseCompiler.java:92)
	at org.rascalmpl.library.experiments.tutor3.CourseCompiler.main(CourseCompiler.java:271)
Caused by: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: Exception in CALLJAVA: org.rascalmpl.library.PreludeCompiled.remove; message: could not call Java method removejava.lang.IllegalArgumentException: java.lang.ClassCastException@72dc7ea1
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.insnCALLJAVA(RVMonJVM.java:454)
	at lang.rascal.boot.Kernel$Compiled.IO\remove(\loc():)#618(Unknown Source)
	at lang.rascal.boot.Kernel$Compiled.experiments::Compiler::Execute\compileAndMergeProgramIncremental(str():bool():adt("PathConfig",()):)#562(Unknown Source)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.executeRVMFunction(RVMonJVM.java:187)
	... 12 more
Caused by: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: could not call Java method remove
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.callJavaMethod(RVMCore.java:1126)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.insnCALLJAVA(RVMonJVM.java:443)
	... 15 more
Caused by: java.lang.IllegalArgumentException: java.lang.ClassCastException@72dc7ea1
	at sun.reflect.GeneratedMethodAccessor35.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.callJavaMethod(RVMCore.java:1122)
	... 16 more

Which procedures call each other indirectly?

We can also determine the indirect calls between procedures, by taking the transitive closure of the Calls relation, written as Calls+. Observe that the transitive closure will contain both the direct and the indirect calls.

rascal>rel[Proc,Proc] closureCalls = Calls+;
An unexpected internal error occurred:
java.lang.RuntimeException: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: Exception in CALLJAVA: org.rascalmpl.library.PreludeCompiled.remove; message: could not call Java method removejava.lang.IllegalArgumentException: java.lang.ClassCastException@131ddbde
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.executeRVMFunction(RVMonJVM.java:193)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMJVM.executeRVMFunction(RVMJVM.java:127)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.executeRVMFunction(RVMCore.java:460)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.java2rascal.RascalFunctionInvocationHandler.invoke(RascalFunctionInvocationHandler.java:85)
	at com.sun.proxy.$Proxy2.compileAndMergeProgramIncremental(Unknown Source)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.executeModule(CommandExecutor.java:361)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.evalDeclaration(CommandExecutor.java:641)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.eval(CommandExecutor.java:447)
	at org.rascalmpl.library.experiments.tutor3.TutorCommandExecutor.evalPrint(TutorCommandExecutor.java:75)
	at org.rascalmpl.library.experiments.tutor3.Concept.preprocess(Concept.java:264)
	at org.rascalmpl.library.experiments.tutor3.Onthology.<init>(Onthology.java:131)
	at org.rascalmpl.library.experiments.tutor3.CourseCompiler.compileCourse(CourseCompiler.java:92)
	at org.rascalmpl.library.experiments.tutor3.CourseCompiler.main(CourseCompiler.java:271)
Caused by: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: Exception in CALLJAVA: org.rascalmpl.library.PreludeCompiled.remove; message: could not call Java method removejava.lang.IllegalArgumentException: java.lang.ClassCastException@131ddbde
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.insnCALLJAVA(RVMonJVM.java:454)
	at lang.rascal.boot.Kernel$Compiled.IO\remove(\loc():)#618(Unknown Source)
	at lang.rascal.boot.Kernel$Compiled.experiments::Compiler::Execute\compileAndMergeProgramIncremental(str():bool():adt("PathConfig",()):)#562(Unknown Source)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.executeRVMFunction(RVMonJVM.java:187)
	... 12 more
Caused by: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: could not call Java method remove
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.callJavaMethod(RVMCore.java:1126)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.insnCALLJAVA(RVMonJVM.java:443)
	... 15 more
Caused by: java.lang.IllegalArgumentException: java.lang.ClassCastException@131ddbde
	at sun.reflect.GeneratedMethodAccessor35.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.callJavaMethod(RVMCore.java:1122)
	... 16 more

Which procedures are called directly or indirectly from each entry point?

We now know the entry points for this application ("a" and "f") and the indirect call relations. Combining this information, we can determine which procedures are called from each entry point. This is done by indexing closureCalls with appropriate procedure name. The index operator yields all right-hand sides of tuples that have a given value as left-hand side. This gives the following:

rascal>set[Proc] calledFromA = closureCalls["a"]
>>>>>>>set[Proc] calledFromF = closureCalls["f"]
[red]##Parse error##

Which procedures are called from all entry points? Finally, we can determine which procedures are called from both entry points by taking the intersection of the two sets calledFromA and calledFromF:

rascal>calledFromA & calledFromF
An unexpected internal error occurred:
java.lang.RuntimeException: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: Exception in CALLJAVA: org.rascalmpl.library.PreludeCompiled.remove; message: could not call Java method removejava.lang.IllegalArgumentException: java.lang.ClassCastException@6e151a19
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.executeRVMFunction(RVMonJVM.java:193)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMJVM.executeRVMFunction(RVMJVM.java:127)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.executeRVMFunction(RVMCore.java:460)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.java2rascal.RascalFunctionInvocationHandler.invoke(RascalFunctionInvocationHandler.java:85)
	at com.sun.proxy.$Proxy2.compileAndMergeProgramIncremental(Unknown Source)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.executeModule(CommandExecutor.java:361)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.evalExpression(CommandExecutor.java:453)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.eval(CommandExecutor.java:438)
	at org.rascalmpl.library.experiments.tutor3.TutorCommandExecutor.evalPrint(TutorCommandExecutor.java:75)
	at org.rascalmpl.library.experiments.tutor3.Concept.preprocess(Concept.java:264)
	at org.rascalmpl.library.experiments.tutor3.Onthology.<init>(Onthology.java:131)
	at org.rascalmpl.library.experiments.tutor3.CourseCompiler.compileCourse(CourseCompiler.java:92)
	at org.rascalmpl.library.experiments.tutor3.CourseCompiler.main(CourseCompiler.java:271)
Caused by: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: Exception in CALLJAVA: org.rascalmpl.library.PreludeCompiled.remove; message: could not call Java method removejava.lang.IllegalArgumentException: java.lang.ClassCastException@6e151a19
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.insnCALLJAVA(RVMonJVM.java:454)
	at lang.rascal.boot.Kernel$Compiled.IO\remove(\loc():)#618(Unknown Source)
	at lang.rascal.boot.Kernel$Compiled.experiments::Compiler::Execute\compileAndMergeProgramIncremental(str():bool():adt("PathConfig",()):)#562(Unknown Source)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.executeRVMFunction(RVMonJVM.java:187)
	... 12 more
Caused by: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: could not call Java method remove
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.callJavaMethod(RVMCore.java:1126)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.insnCALLJAVA(RVMonJVM.java:443)
	... 15 more
Caused by: java.lang.IllegalArgumentException: java.lang.ClassCastException@6e151a19
	at sun.reflect.GeneratedMethodAccessor35.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.callJavaMethod(RVMCore.java:1122)
	... 16 more

or if your prefer to write all of the above as a one-liner using a [$Rascal:Expressions/Reducer] expression:

rascal>(carrier(Calls) | it & (Calls+)[p] | p <- top(Calls));
An unexpected internal error occurred:
java.lang.RuntimeException: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: Exception in CALLJAVA: org.rascalmpl.library.PreludeCompiled.remove; message: could not call Java method removejava.lang.IllegalArgumentException: java.lang.ClassCastException@3cbfa489
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.executeRVMFunction(RVMonJVM.java:193)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMJVM.executeRVMFunction(RVMJVM.java:127)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.executeRVMFunction(RVMCore.java:460)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.java2rascal.RascalFunctionInvocationHandler.invoke(RascalFunctionInvocationHandler.java:85)
	at com.sun.proxy.$Proxy2.compileAndMergeProgramIncremental(Unknown Source)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.executeModule(CommandExecutor.java:361)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.evalStatement(CommandExecutor.java:520)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.eval(CommandExecutor.java:441)
	at org.rascalmpl.library.experiments.tutor3.TutorCommandExecutor.evalPrint(TutorCommandExecutor.java:75)
	at org.rascalmpl.library.experiments.tutor3.Concept.preprocess(Concept.java:264)
	at org.rascalmpl.library.experiments.tutor3.Onthology.<init>(Onthology.java:131)
	at org.rascalmpl.library.experiments.tutor3.CourseCompiler.compileCourse(CourseCompiler.java:92)
	at org.rascalmpl.library.experiments.tutor3.CourseCompiler.main(CourseCompiler.java:271)
Caused by: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: Exception in CALLJAVA: org.rascalmpl.library.PreludeCompiled.remove; message: could not call Java method removejava.lang.IllegalArgumentException: java.lang.ClassCastException@3cbfa489
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.insnCALLJAVA(RVMonJVM.java:454)
	at lang.rascal.boot.Kernel$Compiled.IO\remove(\loc():)#618(Unknown Source)
	at lang.rascal.boot.Kernel$Compiled.experiments::Compiler::Execute\compileAndMergeProgramIncremental(str():bool():adt("PathConfig",()):)#562(Unknown Source)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.executeRVMFunction(RVMonJVM.java:187)
	... 12 more
Caused by: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: could not call Java method remove
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.callJavaMethod(RVMCore.java:1126)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.insnCALLJAVA(RVMonJVM.java:443)
	... 15 more
Caused by: java.lang.IllegalArgumentException: java.lang.ClassCastException@3cbfa489
	at sun.reflect.GeneratedMethodAccessor35.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.callJavaMethod(RVMCore.java:1122)
	... 16 more

The reducer is initialized with all procedures (carrier(Calls)) and iterates over all entry points (p ← top(Calls)). At each iteration the current value of the reducer (it) is intersected (&) with the procedures called directly or indirectly from that entry point ((Calls+)[p]).

3. Benefits

  • In small examples, the above results can be easily obtained by a visual inspection of the call graph. Such a visual inspection does not scale very well to large graphs and this makes the above form of analysis particularly suited for studying large systems.

4. Pitfalls

  • We discuss call analysis in a, intentionally, simplistic fashion that does not take into account how the call relation is extracted from actual source code. The above principles are, however, applicable to real cases as well.

    # Questions

4.1. If

Synopsis

Conditional statement.

Syntax
  • if ( Exp ) Statement;

  • if ( Exp ) Statement1 else Statement2;

Types

Exp

if ( Exp ) Statement;

bool

void

Exp

Statement1

Statement2

if ( Exp ) Statement1 else Statement2;

bool

T1

T2

lub(T1, T2)

Description

The test Exp is evaluated and its outcome determines the statement to be executed: Statement1 if Exp yields true and Statement2 otherwise. The value of an if-then statement is equal to Statement when its test is true. Otherwise it is void. The value of an if-then-else statement is the value of the statement that was executed.

Examples
rascal>if( 3 > 2 ) 30; else 40;
An unexpected internal error occurred:
java.lang.RuntimeException: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: Exception in CALLJAVA: org.rascalmpl.library.PreludeCompiled.remove; message: could not call Java method removejava.lang.IllegalArgumentException: java.lang.ClassCastException@485000e6
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.executeRVMFunction(RVMonJVM.java:193)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMJVM.executeRVMFunction(RVMJVM.java:127)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.executeRVMFunction(RVMCore.java:460)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.java2rascal.RascalFunctionInvocationHandler.invoke(RascalFunctionInvocationHandler.java:85)
	at com.sun.proxy.$Proxy2.compileAndMergeProgramIncremental(Unknown Source)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.executeModule(CommandExecutor.java:361)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.evalStatement(CommandExecutor.java:622)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.eval(CommandExecutor.java:441)
	at org.rascalmpl.library.experiments.tutor3.TutorCommandExecutor.evalPrint(TutorCommandExecutor.java:75)
	at org.rascalmpl.library.experiments.tutor3.Concept.preprocess(Concept.java:264)
	at org.rascalmpl.library.experiments.tutor3.Onthology.<init>(Onthology.java:131)
	at org.rascalmpl.library.experiments.tutor3.CourseCompiler.compileCourse(CourseCompiler.java:92)
	at org.rascalmpl.library.experiments.tutor3.CourseCompiler.main(CourseCompiler.java:271)
Caused by: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: Exception in CALLJAVA: org.rascalmpl.library.PreludeCompiled.remove; message: could not call Java method removejava.lang.IllegalArgumentException: java.lang.ClassCastException@485000e6
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.insnCALLJAVA(RVMonJVM.java:454)
	at lang.rascal.boot.Kernel$Compiled.IO\remove(\loc():)#618(Unknown Source)
	at lang.rascal.boot.Kernel$Compiled.experiments::Compiler::Execute\compileAndMergeProgramIncremental(str():bool():adt("PathConfig",()):)#562(Unknown Source)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.executeRVMFunction(RVMonJVM.java:187)
	... 12 more
Caused by: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: could not call Java method remove
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.callJavaMethod(RVMCore.java:1126)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.insnCALLJAVA(RVMonJVM.java:443)
	... 15 more
Caused by: java.lang.IllegalArgumentException: java.lang.ClassCastException@485000e6
	at sun.reflect.GeneratedMethodAccessor35.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.callJavaMethod(RVMCore.java:1122)
	... 16 more
rascal>x = if( 3 > 2 ) 30; else 40;
An unexpected internal error occurred:
java.lang.RuntimeException: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: Exception in CALLJAVA: org.rascalmpl.library.PreludeCompiled.remove; message: could not call Java method removejava.lang.IllegalArgumentException: java.lang.ClassCastException@76262a40
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.executeRVMFunction(RVMonJVM.java:193)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMJVM.executeRVMFunction(RVMJVM.java:127)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.executeRVMFunction(RVMCore.java:460)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.java2rascal.RascalFunctionInvocationHandler.invoke(RascalFunctionInvocationHandler.java:85)
	at com.sun.proxy.$Proxy2.compileAndMergeProgramIncremental(Unknown Source)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.executeModule(CommandExecutor.java:361)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.evalStatement(CommandExecutor.java:540)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.eval(CommandExecutor.java:441)
	at org.rascalmpl.library.experiments.tutor3.TutorCommandExecutor.evalPrint(TutorCommandExecutor.java:75)
	at org.rascalmpl.library.experiments.tutor3.Concept.preprocess(Concept.java:264)
	at org.rascalmpl.library.experiments.tutor3.Onthology.<init>(Onthology.java:131)
	at org.rascalmpl.library.experiments.tutor3.CourseCompiler.compileCourse(CourseCompiler.java:92)
	at org.rascalmpl.library.experiments.tutor3.CourseCompiler.main(CourseCompiler.java:271)
Caused by: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: Exception in CALLJAVA: org.rascalmpl.library.PreludeCompiled.remove; message: could not call Java method removejava.lang.IllegalArgumentException: java.lang.ClassCastException@76262a40
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.insnCALLJAVA(RVMonJVM.java:454)
	at lang.rascal.boot.Kernel$Compiled.IO\remove(\loc():)#618(Unknown Source)
	at lang.rascal.boot.Kernel$Compiled.experiments::Compiler::Execute\compileAndMergeProgramIncremental(str():bool():adt("PathConfig",()):)#562(Unknown Source)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.executeRVMFunction(RVMonJVM.java:187)
	... 12 more
Caused by: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: could not call Java method remove
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.callJavaMethod(RVMCore.java:1126)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.insnCALLJAVA(RVMonJVM.java:443)
	... 15 more
Caused by: java.lang.IllegalArgumentException: java.lang.ClassCastException@76262a40
	at sun.reflect.GeneratedMethodAccessor35.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.callJavaMethod(RVMCore.java:1122)
	... 16 more
rascal>if( 3 > 2 ) 30;
An unexpected internal error occurred:
java.lang.RuntimeException: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: Exception in CALLJAVA: org.rascalmpl.library.PreludeCompiled.remove; message: could not call Java method removejava.lang.IllegalArgumentException: java.lang.ClassCastException@1a8e3875
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.executeRVMFunction(RVMonJVM.java:193)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMJVM.executeRVMFunction(RVMJVM.java:127)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.executeRVMFunction(RVMCore.java:460)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.java2rascal.RascalFunctionInvocationHandler.invoke(RascalFunctionInvocationHandler.java:85)
	at com.sun.proxy.$Proxy2.compileAndMergeProgramIncremental(Unknown Source)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.executeModule(CommandExecutor.java:361)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.evalStatement(CommandExecutor.java:622)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.eval(CommandExecutor.java:441)
	at org.rascalmpl.library.experiments.tutor3.TutorCommandExecutor.evalPrint(TutorCommandExecutor.java:75)
	at org.rascalmpl.library.experiments.tutor3.Concept.preprocess(Concept.java:264)
	at org.rascalmpl.library.experiments.tutor3.Onthology.<init>(Onthology.java:131)
	at org.rascalmpl.library.experiments.tutor3.CourseCompiler.compileCourse(CourseCompiler.java:92)
	at org.rascalmpl.library.experiments.tutor3.CourseCompiler.main(CourseCompiler.java:271)
Caused by: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: Exception in CALLJAVA: org.rascalmpl.library.PreludeCompiled.remove; message: could not call Java method removejava.lang.IllegalArgumentException: java.lang.ClassCastException@1a8e3875
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.insnCALLJAVA(RVMonJVM.java:454)
	at lang.rascal.boot.Kernel$Compiled.IO\remove(\loc():)#618(Unknown Source)
	at lang.rascal.boot.Kernel$Compiled.experiments::Compiler::Execute\compileAndMergeProgramIncremental(str():bool():adt("PathConfig",()):)#562(Unknown Source)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.executeRVMFunction(RVMonJVM.java:187)
	... 12 more
Caused by: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: could not call Java method remove
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.callJavaMethod(RVMCore.java:1126)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.insnCALLJAVA(RVMonJVM.java:443)
	... 15 more
Caused by: java.lang.IllegalArgumentException: java.lang.ClassCastException@1a8e3875
	at sun.reflect.GeneratedMethodAccessor35.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.callJavaMethod(RVMCore.java:1122)
	... 16 more

An if-then statement yields void when its test is false (demonstrated by the ok that is printed by the Rascal system):

rascal>if( 2 > 3 ) 30;
An unexpected internal error occurred:
java.lang.RuntimeException: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: Exception in CALLJAVA: org.rascalmpl.library.PreludeCompiled.remove; message: could not call Java method removejava.lang.IllegalArgumentException: java.lang.ClassCastException@2abde047
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.executeRVMFunction(RVMonJVM.java:193)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMJVM.executeRVMFunction(RVMJVM.java:127)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.executeRVMFunction(RVMCore.java:460)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.java2rascal.RascalFunctionInvocationHandler.invoke(RascalFunctionInvocationHandler.java:85)
	at com.sun.proxy.$Proxy2.compileAndMergeProgramIncremental(Unknown Source)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.executeModule(CommandExecutor.java:361)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.evalStatement(CommandExecutor.java:622)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.eval(CommandExecutor.java:441)
	at org.rascalmpl.library.experiments.tutor3.TutorCommandExecutor.evalPrint(TutorCommandExecutor.java:75)
	at org.rascalmpl.library.experiments.tutor3.Concept.preprocess(Concept.java:264)
	at org.rascalmpl.library.experiments.tutor3.Onthology.<init>(Onthology.java:131)
	at org.rascalmpl.library.experiments.tutor3.CourseCompiler.compileCourse(CourseCompiler.java:92)
	at org.rascalmpl.library.experiments.tutor3.CourseCompiler.main(CourseCompiler.java:271)
Caused by: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: Exception in CALLJAVA: org.rascalmpl.library.PreludeCompiled.remove; message: could not call Java method removejava.lang.IllegalArgumentException: java.lang.ClassCastException@2abde047
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.insnCALLJAVA(RVMonJVM.java:454)
	at lang.rascal.boot.Kernel$Compiled.IO\remove(\loc():)#618(Unknown Source)
	at lang.rascal.boot.Kernel$Compiled.experiments::Compiler::Execute\compileAndMergeProgramIncremental(str():bool():adt("PathConfig",()):)#562(Unknown Source)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.executeRVMFunction(RVMonJVM.java:187)
	... 12 more
Caused by: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: could not call Java method remove
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.callJavaMethod(RVMCore.java:1126)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.insnCALLJAVA(RVMonJVM.java:443)
	... 15 more
Caused by: java.lang.IllegalArgumentException: java.lang.ClassCastException@2abde047
	at sun.reflect.GeneratedMethodAccessor35.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.callJavaMethod(RVMCore.java:1122)
	... 16 more

4.2. Synopsis

Library functions

4.3. Boolean

Usage

import Boolean;

Synopsis

Library functions for Booleans.

Description

For operators on Boolean values see Boolean in the Rascal Language Reference.

The following functions are defined for Booleans:

  • arbBool: Return an arbitrary Boolean value.

  • fromString: Convert the strings "true" or "false" to a bool

  • toInt: Convert a Boolean value to integer.

  • toReal: Convert Boolean value to real.

  • toString: Convert Boolean value to string.

4.3.1. arbBool

Function

bool arbBool()

Synopsis

Return an arbitrary Boolean value.

Examples
rascal>import Boolean;
An unexpected internal error occurred:
java.lang.RuntimeException: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: Exception in CALLJAVA: org.rascalmpl.library.PreludeCompiled.remove; message: could not call Java method removejava.lang.IllegalArgumentException: java.lang.ClassCastException@32dc28ab
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.executeRVMFunction(RVMonJVM.java:193)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMJVM.executeRVMFunction(RVMJVM.java:127)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.executeRVMFunction(RVMCore.java:460)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.java2rascal.RascalFunctionInvocationHandler.invoke(RascalFunctionInvocationHandler.java:85)
	at com.sun.proxy.$Proxy2.compileAndMergeProgramIncremental(Unknown Source)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.executeModule(CommandExecutor.java:361)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.evalImport(CommandExecutor.java:720)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.eval(CommandExecutor.java:444)
	at org.rascalmpl.library.experiments.tutor3.TutorCommandExecutor.evalPrint(TutorCommandExecutor.java:75)
	at org.rascalmpl.library.experiments.tutor3.Concept.preprocess(Concept.java:264)
	at org.rascalmpl.library.experiments.tutor3.Onthology.<init>(Onthology.java:131)
	at org.rascalmpl.library.experiments.tutor3.CourseCompiler.compileCourse(CourseCompiler.java:92)
	at org.rascalmpl.library.experiments.tutor3.CourseCompiler.main(CourseCompiler.java:271)
Caused by: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: Exception in CALLJAVA: org.rascalmpl.library.PreludeCompiled.remove; message: could not call Java method removejava.lang.IllegalArgumentException: java.lang.ClassCastException@32dc28ab
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.insnCALLJAVA(RVMonJVM.java:454)
	at lang.rascal.boot.Kernel$Compiled.IO\remove(\loc():)#618(Unknown Source)
	at lang.rascal.boot.Kernel$Compiled.experiments::Compiler::Execute\compileAndMergeProgramIncremental(str():bool():adt("PathConfig",()):)#562(Unknown Source)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.executeRVMFunction(RVMonJVM.java:187)
	... 12 more
Caused by: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: could not call Java method remove
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.callJavaMethod(RVMCore.java:1126)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.insnCALLJAVA(RVMonJVM.java:443)
	... 15 more
Caused by: java.lang.IllegalArgumentException: java.lang.ClassCastException@32dc28ab
	at sun.reflect.GeneratedMethodAccessor35.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.callJavaMethod(RVMCore.java:1122)
	... 16 more
rascal>arbBool();
An unexpected internal error occurred:
java.lang.RuntimeException: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: Exception in CALLJAVA: org.rascalmpl.library.PreludeCompiled.remove; message: could not call Java method removejava.lang.IllegalArgumentException: java.lang.ClassCastException@19887e1d
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.executeRVMFunction(RVMonJVM.java:193)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMJVM.executeRVMFunction(RVMJVM.java:127)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.executeRVMFunction(RVMCore.java:460)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.java2rascal.RascalFunctionInvocationHandler.invoke(RascalFunctionInvocationHandler.java:85)
	at com.sun.proxy.$Proxy2.compileAndMergeProgramIncremental(Unknown Source)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.executeModule(CommandExecutor.java:361)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.evalStatement(CommandExecutor.java:520)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.eval(CommandExecutor.java:441)
	at org.rascalmpl.library.experiments.tutor3.TutorCommandExecutor.evalPrint(TutorCommandExecutor.java:75)
	at org.rascalmpl.library.experiments.tutor3.Concept.preprocess(Concept.java:264)
	at org.rascalmpl.library.experiments.tutor3.Onthology.<init>(Onthology.java:131)
	at org.rascalmpl.library.experiments.tutor3.CourseCompiler.compileCourse(CourseCompiler.java:92)
	at org.rascalmpl.library.experiments.tutor3.CourseCompiler.main(CourseCompiler.java:271)
Caused by: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: Exception in CALLJAVA: org.rascalmpl.library.PreludeCompiled.remove; message: could not call Java method removejava.lang.IllegalArgumentException: java.lang.ClassCastException@19887e1d
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.insnCALLJAVA(RVMonJVM.java:454)
	at lang.rascal.boot.Kernel$Compiled.IO\remove(\loc():)#618(Unknown Source)
	at lang.rascal.boot.Kernel$Compiled.experiments::Compiler::Execute\compileAndMergeProgramIncremental(str():bool():adt("PathConfig",()):)#562(Unknown Source)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.executeRVMFunction(RVMonJVM.java:187)
	... 12 more
Caused by: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: could not call Java method remove
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.callJavaMethod(RVMCore.java:1126)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.insnCALLJAVA(RVMonJVM.java:443)
	... 15 more
Caused by: java.lang.IllegalArgumentException: java.lang.ClassCastException@19887e1d
	at sun.reflect.GeneratedMethodAccessor35.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.callJavaMethod(RVMCore.java:1122)
	... 16 more
rascal>arbBool();
An unexpected internal error occurred:
java.lang.RuntimeException: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: Exception in CALLJAVA: org.rascalmpl.library.PreludeCompiled.remove; message: could not call Java method removejava.lang.IllegalArgumentException: java.lang.ClassCastException@10f3c5c9
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.executeRVMFunction(RVMonJVM.java:193)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMJVM.executeRVMFunction(RVMJVM.java:127)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.executeRVMFunction(RVMCore.java:460)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.java2rascal.RascalFunctionInvocationHandler.invoke(RascalFunctionInvocationHandler.java:85)
	at com.sun.proxy.$Proxy2.compileAndMergeProgramIncremental(Unknown Source)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.executeModule(CommandExecutor.java:361)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.evalStatement(CommandExecutor.java:520)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.eval(CommandExecutor.java:441)
	at org.rascalmpl.library.experiments.tutor3.TutorCommandExecutor.evalPrint(TutorCommandExecutor.java:75)
	at org.rascalmpl.library.experiments.tutor3.Concept.preprocess(Concept.java:264)
	at org.rascalmpl.library.experiments.tutor3.Onthology.<init>(Onthology.java:131)
	at org.rascalmpl.library.experiments.tutor3.CourseCompiler.compileCourse(CourseCompiler.java:92)
	at org.rascalmpl.library.experiments.tutor3.CourseCompiler.main(CourseCompiler.java:271)
Caused by: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: Exception in CALLJAVA: org.rascalmpl.library.PreludeCompiled.remove; message: could not call Java method removejava.lang.IllegalArgumentException: java.lang.ClassCastException@10f3c5c9
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.insnCALLJAVA(RVMonJVM.java:454)
	at lang.rascal.boot.Kernel$Compiled.IO\remove(\loc():)#618(Unknown Source)
	at lang.rascal.boot.Kernel$Compiled.experiments::Compiler::Execute\compileAndMergeProgramIncremental(str():bool():adt("PathConfig",()):)#562(Unknown Source)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.executeRVMFunction(RVMonJVM.java:187)
	... 12 more
Caused by: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: could not call Java method remove
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.callJavaMethod(RVMCore.java:1126)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.insnCALLJAVA(RVMonJVM.java:443)
	... 15 more
Caused by: java.lang.IllegalArgumentException: java.lang.ClassCastException@10f3c5c9
	at sun.reflect.GeneratedMethodAccessor35.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.callJavaMethod(RVMCore.java:1122)
	... 16 more
rascal>arbBool();
An unexpected internal error occurred:
java.lang.RuntimeException: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: Exception in CALLJAVA: org.rascalmpl.library.PreludeCompiled.remove; message: could not call Java method removejava.lang.IllegalArgumentException: java.lang.ClassCastException@30f756d6
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.executeRVMFunction(RVMonJVM.java:193)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMJVM.executeRVMFunction(RVMJVM.java:127)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.executeRVMFunction(RVMCore.java:460)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.java2rascal.RascalFunctionInvocationHandler.invoke(RascalFunctionInvocationHandler.java:85)
	at com.sun.proxy.$Proxy2.compileAndMergeProgramIncremental(Unknown Source)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.executeModule(CommandExecutor.java:361)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.evalStatement(CommandExecutor.java:520)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.eval(CommandExecutor.java:441)
	at org.rascalmpl.library.experiments.tutor3.TutorCommandExecutor.evalPrint(TutorCommandExecutor.java:75)
	at org.rascalmpl.library.experiments.tutor3.Concept.preprocess(Concept.java:264)
	at org.rascalmpl.library.experiments.tutor3.Onthology.<init>(Onthology.java:131)
	at org.rascalmpl.library.experiments.tutor3.CourseCompiler.compileCourse(CourseCompiler.java:92)
	at org.rascalmpl.library.experiments.tutor3.CourseCompiler.main(CourseCompiler.java:271)
Caused by: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: Exception in CALLJAVA: org.rascalmpl.library.PreludeCompiled.remove; message: could not call Java method removejava.lang.IllegalArgumentException: java.lang.ClassCastException@30f756d6
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.insnCALLJAVA(RVMonJVM.java:454)
	at lang.rascal.boot.Kernel$Compiled.IO\remove(\loc():)#618(Unknown Source)
	at lang.rascal.boot.Kernel$Compiled.experiments::Compiler::Execute\compileAndMergeProgramIncremental(str():bool():adt("PathConfig",()):)#562(Unknown Source)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.executeRVMFunction(RVMonJVM.java:187)
	... 12 more
Caused by: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: could not call Java method remove
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.callJavaMethod(RVMCore.java:1126)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.insnCALLJAVA(RVMonJVM.java:443)
	... 15 more
Caused by: java.lang.IllegalArgumentException: java.lang.ClassCastException@30f756d6
	at sun.reflect.GeneratedMethodAccessor35.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.callJavaMethod(RVMCore.java:1122)
	... 16 more
Benefits

arbInt is a convenient generator for arbitrary binary choices.

4.3.2. fromString

Function

bool fromString(str s)

Synopsis

Convert the strings "true" or "false" to a bool.

4.3.3. toInt

Function

int toInt(bool b)

Synopsis

Convert a Boolean value to integer.

Description

Maps true to 1 and false to 0.

Examples
rascal>import Boolean;
An unexpected internal error occurred:
java.lang.RuntimeException: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: Exception in CALLJAVA: org.rascalmpl.library.PreludeCompiled.remove; message: could not call Java method removejava.lang.IllegalArgumentException: java.lang.ClassCastException@1118bc6d
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.executeRVMFunction(RVMonJVM.java:193)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMJVM.executeRVMFunction(RVMJVM.java:127)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.executeRVMFunction(RVMCore.java:460)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.java2rascal.RascalFunctionInvocationHandler.invoke(RascalFunctionInvocationHandler.java:85)
	at com.sun.proxy.$Proxy2.compileAndMergeProgramIncremental(Unknown Source)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.executeModule(CommandExecutor.java:361)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.evalImport(CommandExecutor.java:720)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.eval(CommandExecutor.java:444)
	at org.rascalmpl.library.experiments.tutor3.TutorCommandExecutor.evalPrint(TutorCommandExecutor.java:75)
	at org.rascalmpl.library.experiments.tutor3.Concept.preprocess(Concept.java:264)
	at org.rascalmpl.library.experiments.tutor3.Onthology.<init>(Onthology.java:131)
	at org.rascalmpl.library.experiments.tutor3.CourseCompiler.compileCourse(CourseCompiler.java:92)
	at org.rascalmpl.library.experiments.tutor3.CourseCompiler.main(CourseCompiler.java:271)
Caused by: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: Exception in CALLJAVA: org.rascalmpl.library.PreludeCompiled.remove; message: could not call Java method removejava.lang.IllegalArgumentException: java.lang.ClassCastException@1118bc6d
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.insnCALLJAVA(RVMonJVM.java:454)
	at lang.rascal.boot.Kernel$Compiled.IO\remove(\loc():)#618(Unknown Source)
	at lang.rascal.boot.Kernel$Compiled.experiments::Compiler::Execute\compileAndMergeProgramIncremental(str():bool():adt("PathConfig",()):)#562(Unknown Source)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.executeRVMFunction(RVMonJVM.java:187)
	... 12 more
Caused by: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: could not call Java method remove
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.callJavaMethod(RVMCore.java:1126)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.insnCALLJAVA(RVMonJVM.java:443)
	... 15 more
Caused by: java.lang.IllegalArgumentException: java.lang.ClassCastException@1118bc6d
	at sun.reflect.GeneratedMethodAccessor35.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.callJavaMethod(RVMCore.java:1122)
	... 16 more
rascal>toInt(true);
An unexpected internal error occurred:
java.lang.RuntimeException: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: Exception in CALLJAVA: org.rascalmpl.library.PreludeCompiled.remove; message: could not call Java method removejava.lang.IllegalArgumentException: java.lang.ClassCastException@7cd471e0
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.executeRVMFunction(RVMonJVM.java:193)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMJVM.executeRVMFunction(RVMJVM.java:127)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.executeRVMFunction(RVMCore.java:460)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.java2rascal.RascalFunctionInvocationHandler.invoke(RascalFunctionInvocationHandler.java:85)
	at com.sun.proxy.$Proxy2.compileAndMergeProgramIncremental(Unknown Source)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.executeModule(CommandExecutor.java:361)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.evalStatement(CommandExecutor.java:520)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.eval(CommandExecutor.java:441)
	at org.rascalmpl.library.experiments.tutor3.TutorCommandExecutor.evalPrint(TutorCommandExecutor.java:75)
	at org.rascalmpl.library.experiments.tutor3.Concept.preprocess(Concept.java:264)
	at org.rascalmpl.library.experiments.tutor3.Onthology.<init>(Onthology.java:131)
	at org.rascalmpl.library.experiments.tutor3.CourseCompiler.compileCourse(CourseCompiler.java:92)
	at org.rascalmpl.library.experiments.tutor3.CourseCompiler.main(CourseCompiler.java:271)
Caused by: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: Exception in CALLJAVA: org.rascalmpl.library.PreludeCompiled.remove; message: could not call Java method removejava.lang.IllegalArgumentException: java.lang.ClassCastException@7cd471e0
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.insnCALLJAVA(RVMonJVM.java:454)
	at lang.rascal.boot.Kernel$Compiled.IO\remove(\loc():)#618(Unknown Source)
	at lang.rascal.boot.Kernel$Compiled.experiments::Compiler::Execute\compileAndMergeProgramIncremental(str():bool():adt("PathConfig",()):)#562(Unknown Source)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.executeRVMFunction(RVMonJVM.java:187)
	... 12 more
Caused by: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: could not call Java method remove
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.callJavaMethod(RVMCore.java:1126)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.insnCALLJAVA(RVMonJVM.java:443)
	... 15 more
Caused by: java.lang.IllegalArgumentException: java.lang.ClassCastException@7cd471e0
	at sun.reflect.GeneratedMethodAccessor35.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.callJavaMethod(RVMCore.java:1122)
	... 16 more
rascal>toInt(false);
An unexpected internal error occurred:
java.lang.RuntimeException: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: Exception in CALLJAVA: org.rascalmpl.library.PreludeCompiled.remove; message: could not call Java method removejava.lang.IllegalArgumentException: java.lang.ClassCastException@7282d8bd
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.executeRVMFunction(RVMonJVM.java:193)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMJVM.executeRVMFunction(RVMJVM.java:127)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.executeRVMFunction(RVMCore.java:460)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.java2rascal.RascalFunctionInvocationHandler.invoke(RascalFunctionInvocationHandler.java:85)
	at com.sun.proxy.$Proxy2.compileAndMergeProgramIncremental(Unknown Source)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.executeModule(CommandExecutor.java:361)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.evalStatement(CommandExecutor.java:520)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.eval(CommandExecutor.java:441)
	at org.rascalmpl.library.experiments.tutor3.TutorCommandExecutor.evalPrint(TutorCommandExecutor.java:75)
	at org.rascalmpl.library.experiments.tutor3.Concept.preprocess(Concept.java:264)
	at org.rascalmpl.library.experiments.tutor3.Onthology.<init>(Onthology.java:131)
	at org.rascalmpl.library.experiments.tutor3.CourseCompiler.compileCourse(CourseCompiler.java:92)
	at org.rascalmpl.library.experiments.tutor3.CourseCompiler.main(CourseCompiler.java:271)
Caused by: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: Exception in CALLJAVA: org.rascalmpl.library.PreludeCompiled.remove; message: could not call Java method removejava.lang.IllegalArgumentException: java.lang.ClassCastException@7282d8bd
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.insnCALLJAVA(RVMonJVM.java:454)
	at lang.rascal.boot.Kernel$Compiled.IO\remove(\loc():)#618(Unknown Source)
	at lang.rascal.boot.Kernel$Compiled.experiments::Compiler::Execute\compileAndMergeProgramIncremental(str():bool():adt("PathConfig",()):)#562(Unknown Source)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.executeRVMFunction(RVMonJVM.java:187)
	... 12 more
Caused by: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: could not call Java method remove
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.callJavaMethod(RVMCore.java:1126)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.insnCALLJAVA(RVMonJVM.java:443)
	... 15 more
Caused by: java.lang.IllegalArgumentException: java.lang.ClassCastException@7282d8bd
	at sun.reflect.GeneratedMethodAccessor35.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.callJavaMethod(RVMCore.java:1122)
	... 16 more

4.3.4. toReal

Function

real toReal(bool b)

Synopsis

Convert Boolean value to real.

Description

Maps true to 1.0 and false to 0.0.

Examples
rascal>import Boolean;
An unexpected internal error occurred:
java.lang.RuntimeException: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: Exception in CALLJAVA: org.rascalmpl.library.PreludeCompiled.remove; message: could not call Java method removejava.lang.IllegalArgumentException: java.lang.ClassCastException@33adb5a9
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.executeRVMFunction(RVMonJVM.java:193)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMJVM.executeRVMFunction(RVMJVM.java:127)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.executeRVMFunction(RVMCore.java:460)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.java2rascal.RascalFunctionInvocationHandler.invoke(RascalFunctionInvocationHandler.java:85)
	at com.sun.proxy.$Proxy2.compileAndMergeProgramIncremental(Unknown Source)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.executeModule(CommandExecutor.java:361)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.evalImport(CommandExecutor.java:720)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.eval(CommandExecutor.java:444)
	at org.rascalmpl.library.experiments.tutor3.TutorCommandExecutor.evalPrint(TutorCommandExecutor.java:75)
	at org.rascalmpl.library.experiments.tutor3.Concept.preprocess(Concept.java:264)
	at org.rascalmpl.library.experiments.tutor3.Onthology.<init>(Onthology.java:131)
	at org.rascalmpl.library.experiments.tutor3.CourseCompiler.compileCourse(CourseCompiler.java:92)
	at org.rascalmpl.library.experiments.tutor3.CourseCompiler.main(CourseCompiler.java:271)
Caused by: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: Exception in CALLJAVA: org.rascalmpl.library.PreludeCompiled.remove; message: could not call Java method removejava.lang.IllegalArgumentException: java.lang.ClassCastException@33adb5a9
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.insnCALLJAVA(RVMonJVM.java:454)
	at lang.rascal.boot.Kernel$Compiled.IO\remove(\loc():)#618(Unknown Source)
	at lang.rascal.boot.Kernel$Compiled.experiments::Compiler::Execute\compileAndMergeProgramIncremental(str():bool():adt("PathConfig",()):)#562(Unknown Source)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.executeRVMFunction(RVMonJVM.java:187)
	... 12 more
Caused by: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: could not call Java method remove
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.callJavaMethod(RVMCore.java:1126)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.insnCALLJAVA(RVMonJVM.java:443)
	... 15 more
Caused by: java.lang.IllegalArgumentException: java.lang.ClassCastException@33adb5a9
	at sun.reflect.GeneratedMethodAccessor35.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.callJavaMethod(RVMCore.java:1122)
	... 16 more
rascal>toReal(true);
An unexpected internal error occurred:
java.lang.RuntimeException: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: Exception in CALLJAVA: org.rascalmpl.library.PreludeCompiled.remove; message: could not call Java method removejava.lang.IllegalArgumentException: java.lang.ClassCastException@e678067
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.executeRVMFunction(RVMonJVM.java:193)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMJVM.executeRVMFunction(RVMJVM.java:127)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.executeRVMFunction(RVMCore.java:460)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.java2rascal.RascalFunctionInvocationHandler.invoke(RascalFunctionInvocationHandler.java:85)
	at com.sun.proxy.$Proxy2.compileAndMergeProgramIncremental(Unknown Source)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.executeModule(CommandExecutor.java:361)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.evalStatement(CommandExecutor.java:520)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.eval(CommandExecutor.java:441)
	at org.rascalmpl.library.experiments.tutor3.TutorCommandExecutor.evalPrint(TutorCommandExecutor.java:75)
	at org.rascalmpl.library.experiments.tutor3.Concept.preprocess(Concept.java:264)
	at org.rascalmpl.library.experiments.tutor3.Onthology.<init>(Onthology.java:131)
	at org.rascalmpl.library.experiments.tutor3.CourseCompiler.compileCourse(CourseCompiler.java:92)
	at org.rascalmpl.library.experiments.tutor3.CourseCompiler.main(CourseCompiler.java:271)
Caused by: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: Exception in CALLJAVA: org.rascalmpl.library.PreludeCompiled.remove; message: could not call Java method removejava.lang.IllegalArgumentException: java.lang.ClassCastException@e678067
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.insnCALLJAVA(RVMonJVM.java:454)
	at lang.rascal.boot.Kernel$Compiled.IO\remove(\loc():)#618(Unknown Source)
	at lang.rascal.boot.Kernel$Compiled.experiments::Compiler::Execute\compileAndMergeProgramIncremental(str():bool():adt("PathConfig",()):)#562(Unknown Source)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.executeRVMFunction(RVMonJVM.java:187)
	... 12 more
Caused by: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: could not call Java method remove
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.callJavaMethod(RVMCore.java:1126)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.insnCALLJAVA(RVMonJVM.java:443)
	... 15 more
Caused by: java.lang.IllegalArgumentException: java.lang.ClassCastException@e678067
	at sun.reflect.GeneratedMethodAccessor35.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.callJavaMethod(RVMCore.java:1122)
	... 16 more
rascal>toReal(false);
An unexpected internal error occurred:
java.lang.RuntimeException: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: Exception in CALLJAVA: org.rascalmpl.library.PreludeCompiled.remove; message: could not call Java method removejava.lang.IllegalArgumentException: java.lang.ClassCastException@4b94fa4a
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.executeRVMFunction(RVMonJVM.java:193)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMJVM.executeRVMFunction(RVMJVM.java:127)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.executeRVMFunction(RVMCore.java:460)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.java2rascal.RascalFunctionInvocationHandler.invoke(RascalFunctionInvocationHandler.java:85)
	at com.sun.proxy.$Proxy2.compileAndMergeProgramIncremental(Unknown Source)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.executeModule(CommandExecutor.java:361)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.evalStatement(CommandExecutor.java:520)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.eval(CommandExecutor.java:441)
	at org.rascalmpl.library.experiments.tutor3.TutorCommandExecutor.evalPrint(TutorCommandExecutor.java:75)
	at org.rascalmpl.library.experiments.tutor3.Concept.preprocess(Concept.java:264)
	at org.rascalmpl.library.experiments.tutor3.Onthology.<init>(Onthology.java:131)
	at org.rascalmpl.library.experiments.tutor3.CourseCompiler.compileCourse(CourseCompiler.java:92)
	at org.rascalmpl.library.experiments.tutor3.CourseCompiler.main(CourseCompiler.java:271)
Caused by: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: Exception in CALLJAVA: org.rascalmpl.library.PreludeCompiled.remove; message: could not call Java method removejava.lang.IllegalArgumentException: java.lang.ClassCastException@4b94fa4a
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.insnCALLJAVA(RVMonJVM.java:454)
	at lang.rascal.boot.Kernel$Compiled.IO\remove(\loc():)#618(Unknown Source)
	at lang.rascal.boot.Kernel$Compiled.experiments::Compiler::Execute\compileAndMergeProgramIncremental(str():bool():adt("PathConfig",()):)#562(Unknown Source)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.executeRVMFunction(RVMonJVM.java:187)
	... 12 more
Caused by: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: could not call Java method remove
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.callJavaMethod(RVMCore.java:1126)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.insnCALLJAVA(RVMonJVM.java:443)
	... 15 more
Caused by: java.lang.IllegalArgumentException: java.lang.ClassCastException@4b94fa4a
	at sun.reflect.GeneratedMethodAccessor35.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.callJavaMethod(RVMCore.java:1122)
	... 16 more

4.3.5. toString

Function

str toString(bool b)

Synopsis

Convert Boolean value to string.

Description

Maps true to "true" and false to "false".

Examples
rascal>import Boolean;
An unexpected internal error occurred:
java.lang.RuntimeException: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: Exception in CALLJAVA: org.rascalmpl.library.PreludeCompiled.remove; message: could not call Java method removejava.lang.IllegalArgumentException: java.lang.ClassCastException@b220adb
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.executeRVMFunction(RVMonJVM.java:193)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMJVM.executeRVMFunction(RVMJVM.java:127)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.executeRVMFunction(RVMCore.java:460)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.java2rascal.RascalFunctionInvocationHandler.invoke(RascalFunctionInvocationHandler.java:85)
	at com.sun.proxy.$Proxy2.compileAndMergeProgramIncremental(Unknown Source)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.executeModule(CommandExecutor.java:361)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.evalImport(CommandExecutor.java:720)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.eval(CommandExecutor.java:444)
	at org.rascalmpl.library.experiments.tutor3.TutorCommandExecutor.evalPrint(TutorCommandExecutor.java:75)
	at org.rascalmpl.library.experiments.tutor3.Concept.preprocess(Concept.java:264)
	at org.rascalmpl.library.experiments.tutor3.Onthology.<init>(Onthology.java:131)
	at org.rascalmpl.library.experiments.tutor3.CourseCompiler.compileCourse(CourseCompiler.java:92)
	at org.rascalmpl.library.experiments.tutor3.CourseCompiler.main(CourseCompiler.java:271)
Caused by: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: Exception in CALLJAVA: org.rascalmpl.library.PreludeCompiled.remove; message: could not call Java method removejava.lang.IllegalArgumentException: java.lang.ClassCastException@b220adb
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.insnCALLJAVA(RVMonJVM.java:454)
	at lang.rascal.boot.Kernel$Compiled.IO\remove(\loc():)#618(Unknown Source)
	at lang.rascal.boot.Kernel$Compiled.experiments::Compiler::Execute\compileAndMergeProgramIncremental(str():bool():adt("PathConfig",()):)#562(Unknown Source)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.executeRVMFunction(RVMonJVM.java:187)
	... 12 more
Caused by: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: could not call Java method remove
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.callJavaMethod(RVMCore.java:1126)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.insnCALLJAVA(RVMonJVM.java:443)
	... 15 more
Caused by: java.lang.IllegalArgumentException: java.lang.ClassCastException@b220adb
	at sun.reflect.GeneratedMethodAccessor35.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.callJavaMethod(RVMCore.java:1122)
	... 16 more
rascal>toString(true);
An unexpected internal error occurred:
java.lang.RuntimeException: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: Exception in CALLJAVA: org.rascalmpl.library.PreludeCompiled.remove; message: could not call Java method removejava.lang.IllegalArgumentException: java.lang.ClassCastException@4146a75e
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.executeRVMFunction(RVMonJVM.java:193)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMJVM.executeRVMFunction(RVMJVM.java:127)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.executeRVMFunction(RVMCore.java:460)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.java2rascal.RascalFunctionInvocationHandler.invoke(RascalFunctionInvocationHandler.java:85)
	at com.sun.proxy.$Proxy2.compileAndMergeProgramIncremental(Unknown Source)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.executeModule(CommandExecutor.java:361)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.evalStatement(CommandExecutor.java:520)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.eval(CommandExecutor.java:441)
	at org.rascalmpl.library.experiments.tutor3.TutorCommandExecutor.evalPrint(TutorCommandExecutor.java:75)
	at org.rascalmpl.library.experiments.tutor3.Concept.preprocess(Concept.java:264)
	at org.rascalmpl.library.experiments.tutor3.Onthology.<init>(Onthology.java:131)
	at org.rascalmpl.library.experiments.tutor3.CourseCompiler.compileCourse(CourseCompiler.java:92)
	at org.rascalmpl.library.experiments.tutor3.CourseCompiler.main(CourseCompiler.java:271)
Caused by: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: Exception in CALLJAVA: org.rascalmpl.library.PreludeCompiled.remove; message: could not call Java method removejava.lang.IllegalArgumentException: java.lang.ClassCastException@4146a75e
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.insnCALLJAVA(RVMonJVM.java:454)
	at lang.rascal.boot.Kernel$Compiled.IO\remove(\loc():)#618(Unknown Source)
	at lang.rascal.boot.Kernel$Compiled.experiments::Compiler::Execute\compileAndMergeProgramIncremental(str():bool():adt("PathConfig",()):)#562(Unknown Source)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.executeRVMFunction(RVMonJVM.java:187)
	... 12 more
Caused by: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: could not call Java method remove
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.callJavaMethod(RVMCore.java:1126)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.insnCALLJAVA(RVMonJVM.java:443)
	... 15 more
Caused by: java.lang.IllegalArgumentException: java.lang.ClassCastException@4146a75e
	at sun.reflect.GeneratedMethodAccessor35.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.callJavaMethod(RVMCore.java:1122)
	... 16 more
rascal>toString(false);
An unexpected internal error occurred:
java.lang.RuntimeException: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: Exception in CALLJAVA: org.rascalmpl.library.PreludeCompiled.remove; message: could not call Java method removejava.lang.IllegalArgumentException: java.lang.ClassCastException@1509f83
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.executeRVMFunction(RVMonJVM.java:193)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMJVM.executeRVMFunction(RVMJVM.java:127)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.executeRVMFunction(RVMCore.java:460)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.java2rascal.RascalFunctionInvocationHandler.invoke(RascalFunctionInvocationHandler.java:85)
	at com.sun.proxy.$Proxy2.compileAndMergeProgramIncremental(Unknown Source)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.executeModule(CommandExecutor.java:361)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.evalStatement(CommandExecutor.java:520)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.repl.CommandExecutor.eval(CommandExecutor.java:441)
	at org.rascalmpl.library.experiments.tutor3.TutorCommandExecutor.evalPrint(TutorCommandExecutor.java:75)
	at org.rascalmpl.library.experiments.tutor3.Concept.preprocess(Concept.java:264)
	at org.rascalmpl.library.experiments.tutor3.Onthology.<init>(Onthology.java:131)
	at org.rascalmpl.library.experiments.tutor3.CourseCompiler.compileCourse(CourseCompiler.java:92)
	at org.rascalmpl.library.experiments.tutor3.CourseCompiler.main(CourseCompiler.java:271)
Caused by: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: Exception in CALLJAVA: org.rascalmpl.library.PreludeCompiled.remove; message: could not call Java method removejava.lang.IllegalArgumentException: java.lang.ClassCastException@1509f83
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.insnCALLJAVA(RVMonJVM.java:454)
	at lang.rascal.boot.Kernel$Compiled.IO\remove(\loc():)#618(Unknown Source)
	at lang.rascal.boot.Kernel$Compiled.experiments::Compiler::Execute\compileAndMergeProgramIncremental(str():bool():adt("PathConfig",()):)#562(Unknown Source)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.executeRVMFunction(RVMonJVM.java:187)
	... 12 more
Caused by: org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.InternalCompilerError: could not call Java method remove
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.callJavaMethod(RVMCore.java:1126)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMonJVM.insnCALLJAVA(RVMonJVM.java:443)
	... 15 more
Caused by: java.lang.IllegalArgumentException: java.lang.ClassCastException@1509f83
	at sun.reflect.GeneratedMethodAccessor35.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.rascalmpl.library.experiments.Compiler.RVM.Interpreter.RVMCore.callJavaMethod(RVMCore.java:1122)
	... 16 more