src/main/java/org/semgus/java/problem/ProblemGenerator.java
private void consumeHornClause(HornClauseEvent event) {
        TermType termType = termTypes.get(event.constructor().returnType());
        if (termType == null) {
            throw new IllegalStateException("Unknown term type: " + event.constructor().returnType());
        }
        TermConstructor termCtor = termType.constructors.get(event.constructor().name());
        if (termCtor == null) {
            throw new IllegalStateException("Unknown term constructor: " + event.constructor().name());
        }
        // TODO do some checks to ensure all this CHC stuff is well-formed
        termCtor.semanticRules.add(new SemanticRule(
                event.constructor().arguments(),
                event.head(),
                event.bodyRelations(),
                event.constraint()));
    }
/**
     * Collects a semantic rule from a "chc" event for a previously-declared term type.
     *
     * @param event The event.
     */
Collects a semantic rule from a "chc" event for a previously-declared term type.
@param event The event.
Collects a semantic rule from a " chc " event for a previously - declared term type . @param event The event .
private void consumeHornClause(HornClauseEvent event) {
        TermType termType = termTypes.get(event.constructor().returnType());
        if (termType == null) {
            throw new IllegalStateException("Unknown term type: " + event.constructor().returnType());
        }
        TermConstructor termCtor = termType.constructors.get(event.constructor().name());
        if (termCtor == null) {
            throw new IllegalStateException("Unknown term constructor: " + event.constructor().name());
        }
        termCtor.semanticRules.add(new SemanticRule(
                event.constructor().arguments(),
                event.head(),
                event.bodyRelations(),
                event.constraint()));
    }
private void consumeHornClause ( HornClauseEvent event ) { TermType termType = termTypes . get ( event . constructor ( ) . returnType ( ) ) ; if ( termType == null ) { throw new IllegalStateException ( "Unknown term type: " + event . constructor ( ) . returnType ( ) ) ; } TermConstructor termCtor = termType . constructors . get ( event . constructor ( ) . name ( ) ) ; if ( termCtor == null ) { throw new IllegalStateException ( "Unknown term constructor: " + event . constructor ( ) . name ( ) ) ; } termCtor . semanticRules . add ( new SemanticRule ( event . constructor ( ) . arguments ( ) , event . head ( ) , event . bodyRelations ( ) , event . constraint ( ) ) ) ; }
Collects a semantic rule from a "chc" event for a previously-declared term type.
Collects a semantic rule from a " chc " event for a previously - declared term type .
// TODO do some checks to ensure all this CHC stuff is well-formed