Esempio n. 1
0
 protected void BLNprintAttributePredicateDeclaration(
     DDAttribute attr, String objectOfAttribute, IdentifierNamer idNamer, PrintStream out) {
   if (attr.isDiscarded()) return;
   out.print("random ");
   if (attr.isBoolean()) out.print("boolean");
   else
     out.print(
         idNamer.getLongIdentifier("domain", Database.stdDomainName(attr.getDomain().getName())));
   out.println(" " + Database.stdPredicateName(attr.getName()) + "(" + objectOfAttribute + ");");
 }
Esempio n. 2
0
 protected void MLNprintAttributePredicateDeclaration(
     DDAttribute attr, String objectOfAttribute, IdentifierNamer idNamer, PrintStream out) {
   if (attr.isDiscarded()) return;
   out.print(Database.stdPredicateName(attr.getName()) + "(" + objectOfAttribute);
   if (attr.isBoolean()) {
     out.println(")");
     return;
   }
   out.print(", ");
   out.print(
       idNamer.getLongIdentifier("domain", Database.stdDomainName(attr.getDomain().getName())));
   out.println("!)");
 }
Esempio n. 3
0
 protected void outputAttributeList(PrintStream out) {
   Collection<DDAttribute> attributes = getAttributes().values();
   if (attributes.isEmpty()) return;
   out.print(getName() + "_attr_names = [");
   int i = 0;
   for (DDAttribute attrib : attributes) {
     if (attrib.isDiscarded()) continue;
     if (i++ > 0) out.print(", ");
     out.print("'" + Database.stdAttribName(attrib.getName()) + "'");
   }
   out.println("]");
 }
Esempio n. 4
0
 public void MLNprintUnitClauses(IdentifierNamer idNamer, PrintStream out) {
   for (DDAttribute attr : attributes.values()) {
     if (attr.isDiscarded() || attr.isBoolean()) continue;
     String idCategory = attr.getName();
     idNamer.resetCounts();
     out.print(
         Database.stdPredicateName(attr.getName())
             + "("
             + idNamer.getCountedShortIdentifier(idCategory, this.getName()));
     out.print(", +");
     out.println(
         idNamer.getCountedShortIdentifier(attr.getName(), attr.getDomain().getName()) + ")");
   }
 }