+ All Categories
Home > Technology > Doctoral Consortium@RuleML2015: Seamless Cooperation of JAVA and PROLOG for Rule-Based Software...

Doctoral Consortium@RuleML2015: Seamless Cooperation of JAVA and PROLOG for Rule-Based Software...

Date post: 18-Aug-2015
Category:
Upload: ruleml
View: 76 times
Download: 3 times
Share this document with a friend
Popular Tags:
81
Seamless Cooperation of Java and Prolog for Rule-Based Software Development Ludwig Ostermayer University of W¨ urzburg, Department of Computer Science, Efficient Algorithms and Knowledge-Based Systems 04.08.2015 Ludwig Ostermayer (University of W¨ urzburg) Seamless Cooperation of Java and Prolog 04.08.2015
Transcript
Page 1: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Seamless Cooperationof Java and Prolog

for Rule-Based Software Development

Ludwig Ostermayer

University of Wurzburg, Department of Computer Science,Efficient Algorithms and Knowledge-Based Systems

04.08.2015

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 2: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Agenda

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 3: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Modern Software Systems

Modern Software Systems often consist of dynamically linked Subsystems.

Subsystems

modular

solve problems of a certain problem domain

evolve continually and often independently

are implemented with different programming/scripting languages

follow different programming paradigms

Pfeil mit Text Interoperability Problems

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 4: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Modern Software Systems

Modern Software Systems often consist of dynamically linked Subsystems.

Subsystems

modular

solve problems of a certain problem domain

evolve continually and often independently

are implemented with different programming/scripting languages

follow different programming paradigms

Pfeil mit Text Interoperability Problems

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 5: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Modern Software Systems

Modern Software Systems often consist of dynamically linked Subsystems.

Subsystems

modular

solve problems of a certain problem domain

evolve continually and often independently

are implemented with different programming/scripting languages

follow different programming paradigms

Pfeil mit Text Interoperability Problems

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 6: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Modern Software Systems

Modern Software Systems often consist of dynamically linked Subsystems.

Subsystems

modular

solve problems of a certain problem domain

evolve continually and often independently

are implemented with different programming/scripting languages

follow different programming paradigms

Pfeil mit Text Interoperability Problems

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 7: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Modern Software Systems

Modern Software Systems often consist of dynamically linked Subsystems.

Subsystems

modular

solve problems of a certain problem domain

evolve continually and often independently

are implemented with different programming/scripting languages

follow different programming paradigms

Pfeil mit Text Interoperability Problems

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 8: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Object-Oriented Programming

Java

very popular OO language

rich set of libraries and tools

mature integrated development environments

active community

Flaws

verbose and little declarative

no native rule representation

no API for rule-based development

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 9: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Object-Oriented Programming

Java

very popular OO language

rich set of libraries and tools

mature integrated development environments

active community

Flaws

verbose and little declarative

no native rule representation

no API for rule-based development

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 10: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Object-Oriented Programming

Java

very popular OO language

rich set of libraries and tools

mature integrated development environments

active community

Flaws

verbose and little declarative

no native rule representation

no API for rule-based development

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 11: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Object-Oriented Programming

Java

very popular OO language

rich set of libraries and tools

mature integrated development environments

active community

Flaws

verbose and little declarative

no native rule representation

no API for rule-based development

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 12: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Object-Oriented Programming

Java

very popular OO language

rich set of libraries and tools

mature integrated development environments

active community

Flaws

verbose and little declarative

no native rule representation

no API for rule-based development

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 13: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Object-Oriented Programming

Java

very popular OO language

rich set of libraries and tools

mature integrated development environments

active community

Flaws

verbose and little declarative

no native rule representation

no API for rule-based development

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 14: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Object-Oriented Programming

Java

very popular OO language

rich set of libraries and tools

mature integrated development environments

active community

Flaws

verbose and little declarative

no native rule representation

no API for rule-based development

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 15: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Logic Programming

Prolog

rule-based logic programming language

expert systems, linguistics and artificial intelligence

backtracking, partial bindings and incomplete structures

concise and declarative programs

Flaws

different Prolog implementations (BProlog, Ciao, ..., YAP)

platform dependence

programming in the large

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 16: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Logic Programming

Prolog

rule-based logic programming language

expert systems, linguistics and artificial intelligence

backtracking, partial bindings and incomplete structures

concise and declarative programs

Flaws

different Prolog implementations (BProlog, Ciao, ..., YAP)

platform dependence

programming in the large

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 17: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Logic Programming

Prolog

rule-based logic programming language

expert systems, linguistics and artificial intelligence

backtracking, partial bindings and incomplete structures

concise and declarative programs

Flaws

different Prolog implementations (BProlog, Ciao, ..., YAP)

platform dependence

programming in the large

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 18: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Logic Programming

Prolog

rule-based logic programming language

expert systems, linguistics and artificial intelligence

backtracking, partial bindings and incomplete structures

concise and declarative programs

Flaws

different Prolog implementations (BProlog, Ciao, ..., YAP)

platform dependence

programming in the large

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 19: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Logic Programming

Prolog

rule-based logic programming language

expert systems, linguistics and artificial intelligence

backtracking, partial bindings and incomplete structures

concise and declarative programs

Flaws

different Prolog implementations (BProlog, Ciao, ..., YAP)

platform dependence

programming in the large

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 20: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Logic Programming

Prolog

rule-based logic programming language

expert systems, linguistics and artificial intelligence

backtracking, partial bindings and incomplete structures

concise and declarative programs

Flaws

different Prolog implementations (BProlog, Ciao, ..., YAP)

platform dependence

programming in the large

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 21: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Cooperation of Java and Prolog

Reaping the benefits of decades of LP research whilesaving the investment already done for Java!1

1M. Calejo, PACLP, 1999.

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 22: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Cooperation of Java and Prolog

Reaping the benefits of decades of LP research whilesaving the investment already done for Java!1

1M. Calejo, PACLP, 1999.

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 23: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Isn’t it already sufficiently solved?

Related Work

Prolog Cafe (M. Banbara et al., 1997)

Jpl (P. Singleton et al., 1999)

InterProlog ( M. Calejo, 1999)

based on Linguistic Symbiosis (M. D’Hondt, 2004)

based on Annotations and Generics (M. Cimadamore et al., 2007)

Logic Java (T. Majchrzak et al., 2011)

Logic Objects ( S. Castro et al., 2013)

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 24: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Isn’t it already sufficiently solved?

Related Work

Prolog Cafe (M. Banbara et al., 1997)

Jpl (P. Singleton et al., 1999)

InterProlog ( M. Calejo, 1999)

based on Linguistic Symbiosis (M. D’Hondt, 2004)

based on Annotations and Generics (M. Cimadamore et al., 2007)

Logic Java (T. Majchrzak et al., 2011)

Logic Objects ( S. Castro et al., 2013)

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 25: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Observations

Java evolves ... new approaches to cooperate with Prologemerge!

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 26: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Observations

Java evolves ... new approaches to cooperate with Prologemerge!

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 27: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Synthesis of the State of the Art

Continuous Problems

portability

dependence on a specific Prolog implementationdependence on native codemodifications to the Jvm

obfuscation

boilerplate codecomplex blended syntax

overhead

coding praxisperformance

IDE support

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 28: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Synthesis of the State of the Art

Continuous Problems

portability

dependence on a specific Prolog implementationdependence on native codemodifications to the Jvm

obfuscation

boilerplate codecomplex blended syntax

overhead

coding praxisperformance

IDE support

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 29: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Synthesis of the State of the Art

Continuous Problems

portability

dependence on a specific Prolog implementationdependence on native codemodifications to the Jvm

obfuscation

boilerplate codecomplex blended syntax

overhead

coding praxisperformance

IDE support

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 30: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Synthesis of the State of the Art

Continuous Problems

portability

dependence on a specific Prolog implementationdependence on native codemodifications to the Jvm

obfuscation

boilerplate codecomplex blended syntax

overhead

coding praxisperformance

IDE support

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 31: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Synthesis of the State of the Art

Continuous Problems

portability

dependence on a specific Prolog implementationdependence on native codemodifications to the Jvm

obfuscation

boilerplate codecomplex blended syntax

overhead

coding praxisperformance

IDE support

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 32: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Synthesis of the State of the Art

Continuous Problems

portability

dependence on a specific Prolog implementationdependence on native codemodifications to the Jvm

obfuscation

boilerplate codecomplex blended syntax

overhead

coding praxisperformance

IDE support

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 33: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Synthesis of the State of the Art

Continuous Problems

portability

dependence on a specific Prolog implementationdependence on native codemodifications to the Jvm

obfuscation

boilerplate codecomplex blended syntax

overhead

coding praxisperformance

IDE support

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 34: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Synthesis of the State of the Art

Continuous Problems

portability

dependence on a specific Prolog implementationdependence on native codemodifications to the Jvm

obfuscation

boilerplate codecomplex blended syntax

overhead

coding praxisperformance

IDE support

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 35: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Connector Architecture for Prolog and Java

Java

Classes

Annotations

Objects

Prolog

Rules

Facts

PVNGenerator

OTM UnificationTerm

Capja

concise, extensible and intuitive communication layer purelyimplemented in Java

customizable object-term mapping (otm)

pluggable Prolog interface system (default interface included)

not limited to a certain Prolog system

high communication performance during runtime

smooth development cycle with IDE support in Java

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 36: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Connector Architecture for Prolog and Java

Java

Classes

Annotations

Objects

Prolog

Rules

Facts

PVNGenerator

OTM UnificationTerm

Capja

concise, extensible and intuitive communication layer purelyimplemented in Java

customizable object-term mapping (otm)

pluggable Prolog interface system (default interface included)

not limited to a certain Prolog system

high communication performance during runtime

smooth development cycle with IDE support in Java

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 37: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Connector Architecture for Prolog and Java

Java

Classes

Annotations

Objects

Prolog

Rules

Facts

PVNGenerator

OTM UnificationTerm

Capja

concise, extensible and intuitive communication layer purelyimplemented in Java

customizable object-term mapping (otm)

pluggable Prolog interface system (default interface included)

not limited to a certain Prolog system

high communication performance during runtime

smooth development cycle with IDE support in Java

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 38: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Connector Architecture for Prolog and Java

Java

Classes

Annotations

Objects

Prolog

Rules

Facts

PVNGenerator

OTM UnificationTerm

Capja

concise, extensible and intuitive communication layer purelyimplemented in Java

customizable object-term mapping (otm)

pluggable Prolog interface system (default interface included)

not limited to a certain Prolog system

high communication performance during runtime

smooth development cycle with IDE support in Java

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 39: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Connector Architecture for Prolog and Java

Java

Classes

Annotations

Objects

Prolog

Rules

Facts

PVNGenerator

OTM UnificationTerm

Capja

concise, extensible and intuitive communication layer purelyimplemented in Java

customizable object-term mapping (otm)

pluggable Prolog interface system (default interface included)

not limited to a certain Prolog system

high communication performance during runtime

smooth development cycle with IDE support in Java

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 40: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Connector Architecture for Prolog and Java

Java

Classes

Annotations

Objects

Prolog

Rules

Facts

PVNGenerator

OTM UnificationTerm

Capja

concise, extensible and intuitive communication layer purelyimplemented in Java

customizable object-term mapping (otm)

pluggable Prolog interface system (default interface included)

not limited to a certain Prolog system

high communication performance during runtime

smooth development cycle with IDE support in Java

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 41: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Components of Capja

Object-Term Mapping (otm)

default mapping

Annotation layer in Java for a customized mapping

Prolog-View on a given class in Java (@PlView Annotation)

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 42: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Components of Capja

Object-Term Mapping (otm)

default mapping

Annotation layer in Java for a customized mapping

Prolog-View on a given class in Java (@PlView Annotation)

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 43: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Components of Capja

Object-Term Mapping (otm)

default mapping

Annotation layer in Java for a customized mapping

Prolog-View on a given class in Java (@PlView Annotation)

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 44: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Components of Capja

Prolog-View Notation (PVN)

Prolog list-based notation

for the integration of Prolog predicates in Java

describes the structure of a term...

enriched by mapping information for Java

sufficient to generate from it the skeleton of a class...

... or an @PlView Annotation to control the otm from Prolog

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 45: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Components of Capja

Prolog-View Notation (PVN)

Prolog list-based notation

for the integration of Prolog predicates in Java

describes the structure of a term...

enriched by mapping information for Java

sufficient to generate from it the skeleton of a class...

... or an @PlView Annotation to control the otm from Prolog

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 46: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Components of Capja

Prolog-View Notation (PVN)

Prolog list-based notation

for the integration of Prolog predicates in Java

describes the structure of a term...

enriched by mapping information for Java

sufficient to generate from it the skeleton of a class...

... or an @PlView Annotation to control the otm from Prolog

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 47: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Components of Capja

Prolog-View Notation (PVN)

Prolog list-based notation

for the integration of Prolog predicates in Java

describes the structure of a term...

enriched by mapping information for Java

sufficient to generate from it the skeleton of a class...

... or an @PlView Annotation to control the otm from Prolog

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 48: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Components of Capja

Prolog-View Notation (PVN)

Prolog list-based notation

for the integration of Prolog predicates in Java

describes the structure of a term...

enriched by mapping information for Java

sufficient to generate from it the skeleton of a class...

... or an @PlView Annotation to control the otm from Prolog

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 49: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Components of Capja

Pluggable Interface System

(default) Portable Prolog Interface (PPI)

PPI successfully tested with B-, Ciao-, Gnu-, Swi-, Tu-, Xsb-and Yap-Prolog.

works with existing interfaces like Jpl, InterProlog

works with Prolog sockets or servers

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 50: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Components of Capja

Pluggable Interface System

(default) Portable Prolog Interface (PPI)

PPI successfully tested with B-, Ciao-, Gnu-, Swi-, Tu-, Xsb-and Yap-Prolog.

works with existing interfaces like Jpl, InterProlog

works with Prolog sockets or servers

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 51: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Components of Capja

Pluggable Interface System

(default) Portable Prolog Interface (PPI)

PPI successfully tested with B-, Ciao-, Gnu-, Swi-, Tu-, Xsb-and Yap-Prolog.

works with existing interfaces like Jpl, InterProlog

works with Prolog sockets or servers

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 52: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Components of Capja

Pluggable Interface System

(default) Portable Prolog Interface (PPI)

PPI successfully tested with B-, Ciao-, Gnu-, Swi-, Tu-, Xsb-and Yap-Prolog.

works with existing interfaces like Jpl, InterProlog

works with Prolog sockets or servers

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 53: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Components of Capja

Pluggable Interface System

(default) Portable Prolog Interface (PPI)

PPI successfully tested with B-, Ciao-, Gnu-, Swi-, Tu-, Xsb-and Yap-Prolog.

works with existing interfaces like Jpl, InterProlog

works with Prolog sockets or servers

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 54: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Components of Capja

JPLambda

concise and readable Prolog queries in Java

based on Java Lambda expressions

code as data

Lambda expression to further narrow the result set

the Lambda’s evaluation is transferred (where possible) to Prolog

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 55: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Components of Capja

JPLambda

concise and readable Prolog queries in Java

based on Java Lambda expressions

code as data

Lambda expression to further narrow the result set

the Lambda’s evaluation is transferred (where possible) to Prolog

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 56: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Components of Capja

JPLambda

concise and readable Prolog queries in Java

based on Java Lambda expressions

code as data

Lambda expression to further narrow the result set

the Lambda’s evaluation is transferred (where possible) to Prolog

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 57: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Components of Capja

JPLambda

concise and readable Prolog queries in Java

based on Java Lambda expressions

code as data

Lambda expression to further narrow the result set

the Lambda’s evaluation is transferred (where possible) to Prolog

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 58: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Components of Capja

JPLambda

concise and readable Prolog queries in Java

based on Java Lambda expressions

code as data

Lambda expression to further narrow the result set

the Lambda’s evaluation is transferred (where possible) to Prolog

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 59: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Components of Capja

JPLambda

concise and readable Prolog queries in Java

based on Java Lambda expressions

code as data

Lambda expression to further narrow the result set

the Lambda’s evaluation is transferred (where possible) to Prolog

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 60: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Limitations

What Capja (currently) can’t do for you...

support for queries from Prolog to Java (upcoming)

concurrency management

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 61: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Limitations

What Capja (currently) can’t do for you...

support for queries from Prolog to Java (upcoming)

concurrency management

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 62: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Limitations

What Capja (currently) can’t do for you...

support for queries from Prolog to Java (upcoming)

concurrency management

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 63: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Experiments

Case Studies

knowledge bases (e-commerce)

graphs (metro systems)

planning (logistics)

Results

simple and clean code

up to 50% less lines of code (loc) as with pure Java

up to 25% less loc compared to an implementation with Jpl

better or (at least) comparable performance compared to formerapproaches

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 64: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Experiments

Case Studies

knowledge bases (e-commerce)

graphs (metro systems)

planning (logistics)

Results

simple and clean code

up to 50% less lines of code (loc) as with pure Java

up to 25% less loc compared to an implementation with Jpl

better or (at least) comparable performance compared to formerapproaches

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 65: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Experiments

Case Studies

knowledge bases (e-commerce)

graphs (metro systems)

planning (logistics)

Results

simple and clean code

up to 50% less lines of code (loc) as with pure Java

up to 25% less loc compared to an implementation with Jpl

better or (at least) comparable performance compared to formerapproaches

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 66: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Experiments

Case Studies

knowledge bases (e-commerce)

graphs (metro systems)

planning (logistics)

Results

simple and clean code

up to 50% less lines of code (loc) as with pure Java

up to 25% less loc compared to an implementation with Jpl

better or (at least) comparable performance compared to formerapproaches

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 67: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Experiments

Case Studies

knowledge bases (e-commerce)

graphs (metro systems)

planning (logistics)

Results

simple and clean code

up to 50% less lines of code (loc) as with pure Java

up to 25% less loc compared to an implementation with Jpl

better or (at least) comparable performance compared to formerapproaches

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 68: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Experiments

Case Studies

knowledge bases (e-commerce)

graphs (metro systems)

planning (logistics)

Results

simple and clean code

up to 50% less lines of code (loc) as with pure Java

up to 25% less loc compared to an implementation with Jpl

better or (at least) comparable performance compared to formerapproaches

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 69: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Experiments

Case Studies

knowledge bases (e-commerce)

graphs (metro systems)

planning (logistics)

Results

simple and clean code

up to 50% less lines of code (loc) as with pure Java

up to 25% less loc compared to an implementation with Jpl

better or (at least) comparable performance compared to formerapproaches

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 70: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Thanks for the Attention!

Questions are welcome!

[email protected]

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 71: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Talk is cheap. Show me the Code.2

A Person class with two different Prolog-Views...

1 @PlView(viewId="V1", dropArgs={"familyName"},2 modifyArgs={@PlArg(valueOf="children",viewId="V2")})3 @PlView(viewId="V2", functor="child",4 orderArgs={"firstName"})5 class Person {6 private String firstName;7 private String familyName;8 private int age;9 private ArrayList<Person> children;

10 //...constructors and methods...11 }

... and its corresponding PVN representation.

1 pl_view(person, compound, [pl_arg(firstName, string),2 pl_arg(familyName, string), pl_arg(age, int),3 pl_arg(children, arrayList, person)]).

2Linus Torvald

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 72: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Talk is cheap. Show me the Code.2

A Person class with two different Prolog-Views...

1 @PlView(viewId="V1", dropArgs={"familyName"},2 modifyArgs={@PlArg(valueOf="children",viewId="V2")})3 @PlView(viewId="V2", functor="child",4 orderArgs={"firstName"})5 class Person {6 private String firstName;7 private String familyName;8 private int age;9 private ArrayList<Person> children;

10 //...constructors and methods...11 }

... and its corresponding PVN representation.

1 pl_view(person, compound, [pl_arg(firstName, string),2 pl_arg(familyName, string), pl_arg(age, int),3 pl_arg(children, arrayList, person)]).

2Linus Torvald

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 73: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Talk is cheap. Show me the Code.2

A Person class with two different Prolog-Views...

1 @PlView(viewId="V1", dropArgs={"familyName"},2 modifyArgs={@PlArg(valueOf="children",viewId="V2")})3 @PlView(viewId="V2", functor="child",4 orderArgs={"firstName"})5 class Person {6 private String firstName;7 private String familyName;8 private int age;9 private ArrayList<Person> children;

10 //...constructors and methods...11 }

... and its corresponding PVN representation.

1 pl_view(person, compound, [pl_arg(firstName, string),2 pl_arg(familyName, string), pl_arg(age, int),3 pl_arg(children, arrayList, person)]).

2Linus Torvald

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 74: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Talk is cheap. Show me the Code.2

A Person class with two different Prolog-Views...

1 @PlView(viewId="V1", dropArgs={"familyName"},2 modifyArgs={@PlArg(valueOf="children",viewId="V2")})3 @PlView(viewId="V2", functor="child",4 orderArgs={"firstName"})5 class Person {6 private String firstName;7 private String familyName;8 private int age;9 private ArrayList<Person> children;

10 //...constructors and methods...11 }

... and its corresponding PVN representation.

1 pl_view(person, compound, [pl_arg(firstName, string),2 pl_arg(familyName, string), pl_arg(age, int),3 pl_arg(children, arrayList, person)]).

2Linus Torvald

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 75: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Talk is cheap. Show me the Code.2

A Person class with two different Prolog-Views...

1 @PlView(viewId="V1", dropArgs={"familyName"},2 modifyArgs={@PlArg(valueOf="children",viewId="V2")})3 @PlView(viewId="V2", functor="child",4 orderArgs={"firstName"})5 class Person {6 private String firstName;7 private String familyName;8 private int age;9 private ArrayList<Person> children;

10 //...constructors and methods...11 }

... and its corresponding PVN representation.

1 pl_view(person, compound, [pl_arg(firstName, string),2 pl_arg(familyName, string), pl_arg(age, int),3 pl_arg(children, arrayList, person)]).

2Linus Torvald

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 76: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Some objects...

1 Person homer = new Person("Homer", null, 40);2 Person bart = new Person("Bart", "Stimpson", 10);3 homer.getChildren().add(bart);

...that we map via the otm to terms...

1 % default mapping of homer2 person('Homer', X, 40, [person('Bart',10,[])]).3 % the Prolog-View "V1" of homer4 person('Homer', 40, [child('Bart')]).

... and that can be queried using a JPLambda.

1 Unifier<Person> personUnifier = new Unifier$3141<>(2 person -> person.getFamilyName() == "Stimpson"3 && person.getAge() < 18);4 //person(FirstName, 'Stimpson', Age, Children), Age < 185 Iterator<Person> personIt1 = personUnifier.unify();6 Iterator<Person> personIt2 = personUnifier.findall();

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 77: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Some objects...

1 Person homer = new Person("Homer", null, 40);2 Person bart = new Person("Bart", "Stimpson", 10);3 homer.getChildren().add(bart);

...that we map via the otm to terms...

1 % default mapping of homer2 person('Homer', X, 40, [person('Bart',10,[])]).3 % the Prolog-View "V1" of homer4 person('Homer', 40, [child('Bart')]).

... and that can be queried using a JPLambda.

1 Unifier<Person> personUnifier = new Unifier$3141<>(2 person -> person.getFamilyName() == "Stimpson"3 && person.getAge() < 18);4 //person(FirstName, 'Stimpson', Age, Children), Age < 185 Iterator<Person> personIt1 = personUnifier.unify();6 Iterator<Person> personIt2 = personUnifier.findall();

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 78: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Some objects...

1 Person homer = new Person("Homer", null, 40);2 Person bart = new Person("Bart", "Stimpson", 10);3 homer.getChildren().add(bart);

...that we map via the otm to terms...

1 % default mapping of homer2 person('Homer', X, 40, [person('Bart',10,[])]).3 % the Prolog-View "V1" of homer4 person('Homer', 40, [child('Bart')]).

... and that can be queried using a JPLambda.

1 Unifier<Person> personUnifier = new Unifier$3141<>(2 person -> person.getFamilyName() == "Stimpson"3 && person.getAge() < 18);4 //person(FirstName, 'Stimpson', Age, Children), Age < 185 Iterator<Person> personIt1 = personUnifier.unify();6 Iterator<Person> personIt2 = personUnifier.findall();

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 79: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Some objects...

1 Person homer = new Person("Homer", null, 40);2 Person bart = new Person("Bart", "Stimpson", 10);3 homer.getChildren().add(bart);

...that we map via the otm to terms...

1 % default mapping of homer2 person('Homer', X, 40, [person('Bart',10,[])]).3 % the Prolog-View "V1" of homer4 person('Homer', 40, [child('Bart')]).

... and that can be queried using a JPLambda.

1 Unifier<Person> personUnifier = new Unifier$3141<>(2 person -> person.getFamilyName() == "Stimpson"3 && person.getAge() < 18);4 //person(FirstName, 'Stimpson', Age, Children), Age < 185 Iterator<Person> personIt1 = personUnifier.unify();6 Iterator<Person> personIt2 = personUnifier.findall();

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 80: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Some objects...

1 Person homer = new Person("Homer", null, 40);2 Person bart = new Person("Bart", "Stimpson", 10);3 homer.getChildren().add(bart);

...that we map via the otm to terms...

1 % default mapping of homer2 person('Homer', X, 40, [person('Bart',10,[])]).3 % the Prolog-View "V1" of homer4 person('Homer', 40, [child('Bart')]).

... and that can be queried using a JPLambda.

1 Unifier<Person> personUnifier = new Unifier$3141<>(2 person -> person.getFamilyName() == "Stimpson"3 && person.getAge() < 18);4 //person(FirstName, 'Stimpson', Age, Children), Age < 185 Iterator<Person> personIt1 = personUnifier.unify();6 Iterator<Person> personIt2 = personUnifier.findall();

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015

Page 81: Doctoral Consortium@RuleML2015:  Seamless Cooperation of JAVA and PROLOG for Rule-Based Software Development

Some objects...

1 Person homer = new Person("Homer", null, 40);2 Person bart = new Person("Bart", "Stimpson", 10);3 homer.getChildren().add(bart);

...that we map via the otm to terms...

1 % default mapping of homer2 person('Homer', X, 40, [person('Bart',10,[])]).3 % the Prolog-View "V1" of homer4 person('Homer', 40, [child('Bart')]).

... and that can be queried using a JPLambda.

1 Unifier<Person> personUnifier = new Unifier$3141<>(2 person -> person.getFamilyName() == "Stimpson"3 && person.getAge() < 18);4 //person(FirstName, 'Stimpson', Age, Children), Age < 185 Iterator<Person> personIt1 = personUnifier.unify();6 Iterator<Person> personIt2 = personUnifier.findall();

Ludwig Ostermayer (University of Wurzburg) Seamless Cooperation of Java and Prolog 04.08.2015


Recommended