Merge branch 'master' of https://github.com/vscosta/yap-6.3
This commit is contained in:
commit
76638bb7d8
10
C/index.c
10
C/index.c
@ -3640,6 +3640,7 @@ static yamop **expand_index(struct intermediates *cint) {
|
|||||||
if (s_reg[-1] != (CELL)FunctorDBREF) {
|
if (s_reg[-1] != (CELL)FunctorDBREF) {
|
||||||
ipc = alt;
|
ipc = alt;
|
||||||
alt = NULL;
|
alt = NULL;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
t = AbsAppl(s_reg - 1);
|
t = AbsAppl(s_reg - 1);
|
||||||
sp[-1].extra = t;
|
sp[-1].extra = t;
|
||||||
@ -3647,9 +3648,10 @@ static yamop **expand_index(struct intermediates *cint) {
|
|||||||
ipc = NEXTOP(ipc, e);
|
ipc = NEXTOP(ipc, e);
|
||||||
break;
|
break;
|
||||||
case _index_blob:
|
case _index_blob:
|
||||||
if (s_reg[-1] != (CELL)FunctorBigInt) {
|
if (s_reg[-1] != (CELL)FunctorDouble) {
|
||||||
ipc = alt;
|
ipc = alt;
|
||||||
alt = NULL;
|
alt = NULL;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
t = Yap_DoubleP_key(s_reg);
|
t = Yap_DoubleP_key(s_reg);
|
||||||
sp[-1].extra = AbsAppl(s_reg - 1);
|
sp[-1].extra = AbsAppl(s_reg - 1);
|
||||||
@ -3660,6 +3662,7 @@ static yamop **expand_index(struct intermediates *cint) {
|
|||||||
if (s_reg[-1] != (CELL)FunctorLongInt) {
|
if (s_reg[-1] != (CELL)FunctorLongInt) {
|
||||||
ipc = alt;
|
ipc = alt;
|
||||||
alt = NULL;
|
alt = NULL;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
t = Yap_IntP_key(s_reg);
|
t = Yap_IntP_key(s_reg);
|
||||||
sp[-1].extra = AbsAppl(s_reg - 1);
|
sp[-1].extra = AbsAppl(s_reg - 1);
|
||||||
@ -6583,14 +6586,16 @@ LogUpdClause *Yap_FollowIndexingCode(PredEntry *ap, yamop *ipc, Term Terms[3],
|
|||||||
case _index_dbref:
|
case _index_dbref:
|
||||||
if (s_reg[-1] != (CELL)FunctorDBREF) {
|
if (s_reg[-1] != (CELL)FunctorDBREF) {
|
||||||
ipc = FAILCODE;
|
ipc = FAILCODE;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
t = AbsAppl(s_reg - 1);
|
t = AbsAppl(s_reg - 1);
|
||||||
blob_term = FALSE;
|
blob_term = FALSE;
|
||||||
ipc = NEXTOP(ipc, e);
|
ipc = NEXTOP(ipc, e);
|
||||||
break;
|
break;
|
||||||
case _index_blob:
|
case _index_blob:
|
||||||
if (s_reg[-1] != (CELL)FunctorBigInt) {
|
if (s_reg[-1] != (CELL)FunctorDouble) {
|
||||||
ipc = FAILCODE;
|
ipc = FAILCODE;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
t = Yap_DoubleP_key(s_reg);
|
t = Yap_DoubleP_key(s_reg);
|
||||||
blob_term = TRUE;
|
blob_term = TRUE;
|
||||||
@ -6599,6 +6604,7 @@ LogUpdClause *Yap_FollowIndexingCode(PredEntry *ap, yamop *ipc, Term Terms[3],
|
|||||||
case _index_long:
|
case _index_long:
|
||||||
if (s_reg[-1] != (CELL)FunctorLongInt) {
|
if (s_reg[-1] != (CELL)FunctorLongInt) {
|
||||||
ipc = FAILCODE;
|
ipc = FAILCODE;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
t = Yap_IntP_key(s_reg);
|
t = Yap_IntP_key(s_reg);
|
||||||
blob_term = TRUE;
|
blob_term = TRUE;
|
||||||
|
@ -1,47 +0,0 @@
|
|||||||
# python commands
|
|
||||||
|
|
||||||
import sys
|
|
||||||
# import collections
|
|
||||||
|
|
||||||
# generated by swig
|
|
||||||
import yap
|
|
||||||
|
|
||||||
# make sure Python knows about engine
|
|
||||||
engine = None
|
|
||||||
|
|
||||||
# Mappings between functors and types
|
|
||||||
#
|
|
||||||
# they are used to have the same type f1or several occurences
|
|
||||||
# of the same functor, and to ensure that an object is indeed
|
|
||||||
# a Prolog compound term.
|
|
||||||
#
|
|
||||||
dictF2P = {}
|
|
||||||
|
|
||||||
|
|
||||||
class A:
|
|
||||||
"""Represents a non-interned Prolog atom"""
|
|
||||||
def __init__(self, s):
|
|
||||||
self.a = s
|
|
||||||
|
|
||||||
def __repr__(self):
|
|
||||||
return "A(" + self.a + ")"
|
|
||||||
|
|
||||||
def __str__(self):
|
|
||||||
return self.a
|
|
||||||
|
|
||||||
|
|
||||||
class V:
|
|
||||||
"""Wraps a term, or a reference to a logical variables"""
|
|
||||||
def __init__(self, t):
|
|
||||||
print(type(t))
|
|
||||||
self.v = t
|
|
||||||
|
|
||||||
def __repr__(self):
|
|
||||||
return "V(" + str(self.v) + ")"
|
|
||||||
|
|
||||||
def __str__(self):
|
|
||||||
return engine.getTerm(self.v).text()
|
|
||||||
|
|
||||||
def handle(self):
|
|
||||||
return self.v
|
|
||||||
|
|
Reference in New Issue
Block a user