EmbASP-Python
EmbASP-Python
languages
predicate.py
1
from
abc
import
ABCMeta
2
3
4
class
Predicate
(object):
5
"""This class have to be implemented by subclasses in order to
6
represent a predicate."""
7
8
__metaclass__ = ABCMeta
9
10
def
__init__(self, terms):
11
index = 0
12
# Dict where positional id and set of terms are stored
13
self.
__map_terms_type
= dict()
14
for
val
in
terms:
15
if
isinstance(val, tuple)
and
len(terms) > 1
and
len(val) > 2:
16
raise
Exception(
"Bad definition of term"
)
17
self.
__map_terms_type
[index] = val
18
index += 1
19
20
@classmethod
21
def
get_predicate_name
(cls):
22
"""Return a string representing the name of a predicate."""
23
return
cls.predicate_name
24
25
def
get_terms_type
(self):
26
"""Return a __map_terms_type dict."""
27
return
self.
__map_terms_type
languages.predicate.Predicate.__map_terms_type
__map_terms_type
Definition:
predicate.py:13
languages.predicate.Predicate.get_terms_type
def get_terms_type(self)
Definition:
predicate.py:25
languages.predicate.Predicate.get_predicate_name
def get_predicate_name(cls)
Definition:
predicate.py:21
languages.predicate.Predicate
Definition:
predicate.py:4
Generated by
1.8.17