Concurrency Language  Implementations
concurrent  GHC
parallel KL1 (PIM), KLIC, KLIJava, etc.
distributed dKL1, KL1j  dKLIC, KL1j

図 1: GHC vs. KL1, dKL1

Local                           Remote
remote call - - - - - - - -> predicate
||                          ||   meta-call
stub ==================== skeleton
    socket communication

図 2: Stub-Skeleton Framework for Remote Predicate Call

Layer 3:  Remote Predicate Call
Layer 2:  Marshalling / Unmarshalling
Layer 1:  Variable Table

図 3: Layers in dKLIC Implementation

  Local                     Remote
  Stub                    Skeleton
  [Value=Name]--------[Name=Value]
               socket

図 4: Variable Tables

   +-----------------+
   |  User Program   |
   |     in dKL1     |
   +-----------------+
           | dKLIC Compiler
           V               +-----------------------+
   +-----------------+     | dKLIC Runtime Library |
   |   in KLIC/KL1   |     |      in KLIC/KL1      |
   +-----------------+     +-----------------------+
           V  KLIC Compiler           V  KLIC Compiler
   +-----------------+     +-----------------------+
   | in Machine Code |     |    in Machine Code    |
   +-----------------+-----+-----------------------+
                     Machine

図 5: dKLIC Configuration

       Client
+-------------------+
|    Remote Call    |
|      in dKL1      |
+-------------------+
          V  dKLIC Compiler
+-------------------+
|     Stub Call     |
|     with Stub     |
|    in KLIC/KL1    |
+-------------------+
          V   KLIC Compiler
+-------------------+
|   Machine Code    |
| executed at Local |
+-------------------+

                                       Server
                              +-------------------------+
                              | Remote-Called Predicate |
                              |         in dKL1         |
                              +-------------------------+
                                          V  dKLIC Compiler
                              +-------------------------+
                              |  Meta-Called Predicate  |
                              |      with Skeleton      |
                              |       in KLIC/KL1       |
                              +-------------------------+
                                          V   KLIC Compiler
                              +-------------------------+
                              |      Machine Code       |
                              |   executed at Remote    |
                              +-------------------------+

図 6: Client-Server in dKL1

         server(Queue) :- Queue = [] |
           true.
         server(Queue) :- Queue = [Request|Q] |
           Request = answer,
           server(Q).

図 7: Predicate server/1

                   Local   Remote
Client        Stub                Skeleton        Server
              Marshall
Remote-Call  -----------------------------> Meta-Call
                                               Reduction
Answer       <----------------------------- Instantiation
                                 Marshall
                   server(_0)
server(Queue)     --------------->
  @node(Remote).                           server(Queue).
                   _0 = [_1|_2]              ||
Queue=[Request|Q] --------------->         :- Queue = [Request|Q] |
                  <---------------           Request = answer,
                      _1 = answer            server(Q).
                   _2 = []                     ||
Q=[]              --------------->         :- Q = [] |
                                            true.

図 8: Communication and Reduction for server/1

           ["_2"=Q, "_1"=Request, "_0"=Queue]

図 9: Variable Table for server/1