1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 package io.github.prolobjectlink.prolog.jpl.yap;
23
24 import io.github.prolobjectlink.prolog.PrologConverter;
25 import io.github.prolobjectlink.prolog.PrologEngine;
26 import io.github.prolobjectlink.prolog.PrologJavaConverter;
27 import io.github.prolobjectlink.prolog.PrologProvider;
28 import io.github.prolobjectlink.prolog.jpl.JplProvider;
29 import jpl.Term;
30
31
32
33
34
35
36 public class YapProlog extends JplProvider implements PrologProvider {
37
38 public YapProlog() {
39 super(new YapPrologConverter());
40 }
41
42 YapProlog(PrologConverter<Term> converter) {
43 super(converter);
44 }
45
46 public PrologJavaConverter getJavaConverter() {
47 return new YapPrologJavaConverter(this);
48 }
49
50 public PrologEngine newEngine() {
51 return new YapPrologEngine(this);
52 }
53
54 public PrologEngine newEngine(String path) {
55 PrologEngine engine = newEngine();
56 engine.consult(path);
57 return engine;
58 }
59
60 @Override
61 public String toString() {
62 return "YapProlog [converter=" + converter + "]";
63 }
64
65 }