src/main/java/org/semgus/java/problem/SemgusProblem.java
public String dump() {
        StringBuilder sb = new StringBuilder();

        // print the grammar
        for (SemgusNonTerminal nonTerminal : nonTerminals.values()) {
            // print the non-terminal name
            sb.append(nonTerminal.name()).append(" →\n");
            // print each production
            for (SemgusProduction production : nonTerminal.productions().values()) {
                // print the production's symbol and child term non-terminals
                sb.append("  ").append(production.operator());
                if (!production.childNonTerminals().isEmpty()) {
                    for (SemgusNonTerminal childNonTerminal : production.childNonTerminals()) {
                        sb.append(" ").append(childNonTerminal.name());
                    }
                }
                sb.append("\n");
                // print the production's semantic rules
                for (SemanticRule rule : production.semanticRules()) {
                    sb.append("    ").append(rule.head()).append(" :- ");
                    boolean first = true;
                    for (RelationApp rel : rule.bodyRelations()) {
                        if (first) {
                            first = false;
                        } else {
                            sb.append(" ∧ ");
                        }
                        sb.append(rel);
                    }
                    if (!first) {
                        sb.append(" ∧ ");
                    }
                    sb.append(rule.constraint()).append("\n");
                }
            }
        }
        sb.append("\n");

        // print the constraints
        boolean first = true;
        for (SmtTerm constraint : constraints) {
            if (first) {
                first = false;
            } else {
                sb.append("\n");
            }
            sb.append(constraint);
        }
        return sb.toString();
    }
/**
     * Produces a human-readable string representation (over multiple lines) of this synthesis problem.
     *
     * @return Human-readable stringification of this synthesis problem.
     */
Produces a human-readable string representation (over multiple lines) of this synthesis problem.
@return Human-readable stringification of this synthesis problem.
Produces a human - readable string representation ( over multiple lines ) of this synthesis problem . @return Human - readable stringification of this synthesis problem .
public String dump() {
        StringBuilder sb = new StringBuilder();
        for (SemgusNonTerminal nonTerminal : nonTerminals.values()) {
            sb.append(nonTerminal.name()).append(" →\n");
            for (SemgusProduction production : nonTerminal.productions().values()) {
                sb.append("  ").append(production.operator());
                if (!production.childNonTerminals().isEmpty()) {
                    for (SemgusNonTerminal childNonTerminal : production.childNonTerminals()) {
                        sb.append(" ").append(childNonTerminal.name());
                    }
                }
                sb.append("\n");
                for (SemanticRule rule : production.semanticRules()) {
                    sb.append("    ").append(rule.head()).append(" :- ");
                    boolean first = true;
                    for (RelationApp rel : rule.bodyRelations()) {
                        if (first) {
                            first = false;
                        } else {
                            sb.append(" ∧ ");
                        }
                        sb.append(rel);
                    }
                    if (!first) {
                        sb.append(" ∧ ");
                    }
                    sb.append(rule.constraint()).append("\n");
                }
            }
        }
        sb.append("\n");
        boolean first = true;
        for (SmtTerm constraint : constraints) {
            if (first) {
                first = false;
            } else {
                sb.append("\n");
            }
            sb.append(constraint);
        }
        return sb.toString();
    }
public String dump ( ) { StringBuilder sb = new StringBuilder ( ) ; for ( SemgusNonTerminal nonTerminal : nonTerminals . values ( ) ) { sb . append ( nonTerminal . name ( ) ) . append ( " →\n"); for ( SemgusProduction production : nonTerminal . productions ( ) . values ( ) ) { sb . append ( "  " ) . append ( production . operator ( ) ) ; if ( ! production . childNonTerminals ( ) . isEmpty ( ) ) { for ( SemgusNonTerminal childNonTerminal : production . childNonTerminals ( ) ) { sb . append ( " " ) . append ( childNonTerminal . name ( ) ) ; } } sb . append ( "\n" ) ; for ( SemanticRule rule : production . semanticRules ( ) ) { sb . append ( "    " ) . append ( rule . head ( ) ) . append ( " :- " ) ; boolean first = true ; for ( RelationApp rel : rule . bodyRelations ( ) ) { if ( first ) { first = false ; } else { sb . append ( " ∧ "); } sb . append ( rel ) ; } if ( ! first ) { sb . append ( " ∧ "); } sb . append ( rule . constraint ( ) ) . append ( "\n" ) ; } } } sb . append ( "\n" ) ; boolean first = true ; for ( SmtTerm constraint : constraints ) { if ( first ) { first = false ; } else { sb . append ( "\n" ) ; } sb . append ( constraint ) ; } return sb . toString ( ) ; }
Produces a human-readable string representation (over multiple lines) of this synthesis problem.
Produces a human - readable string representation ( over multiple lines ) of this synthesis problem .
// print the grammar // print the non-terminal name // print each production // print the production's symbol and child term non-terminals // print the production's semantic rules // print the constraints