This commit is contained in:
Vítor Santos Costa
2018-03-18 00:44:08 +00:00
parent cc6eca6903
commit af610dc16d
12 changed files with 437 additions and 1096 deletions

View File

@@ -1,5 +1,6 @@
# include CONTRIBUTING.md
include README.md
include *.py
recursive-include yap4py/prolog *.*
recursive-include html *.*

View File

@@ -30,4 +30,4 @@ else:
dll = glob.glob(os.path.join(os.path.dirname(__file__),dll))[0]
dll = os.path.abspath(dll)
ctypes.CDLL(dll)
load('_yap*.so')
#load('_yap*.so')

View File

@@ -1,5 +1,5 @@
import readline
from yap4py.yap import YAPEngine, YAPEngineArgs, YAPPredicate, YAPQuery, YAPPrologPredicate, YAPVarTerm
from yap4py.yap import *
from os.path import join, dirname
from collections import namedtuple
import sys
@@ -144,7 +144,7 @@ class YAPShell:
# if not isinstance(eq[0],str):
# print( "Error: Variable Name matches a Python Symbol")
# return
do_ask = True
self.do_ask = True
engine = self.engine
bindings = []
g = python_query(self, query)
@@ -152,7 +152,7 @@ class YAPShell:
self.q = Query( engine, g )
for bind in self.q:
bindings += [bind]
if do_ask:
if self.do_ask:
print(bindings)
bindings = []
s = input("more(;), all(*), no(\\n), python(#) ?").lstrip()
@@ -166,7 +166,7 @@ class YAPShell:
except:
raise
elif s.startswith('*') or s.startswith('a'):
do_ask = False
self.do_ask = False
continue
else:
break