All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jvmMain.it.unibo.tuprolog.theory.parsing.ClausesParserImpl.kt Maven / Gradle / Ivy

Go to download

Parsing facilities for knoledge bases made up of logic clauses, out of Prolog standard syntax

There is a newer version: 1.0.4
Show newest version
package it.unibo.tuprolog.theory.parsing

import it.unibo.tuprolog.core.Clause
import it.unibo.tuprolog.core.operators.OperatorSet
import it.unibo.tuprolog.core.parsing.PrologExpressionVisitor
import it.unibo.tuprolog.core.parsing.PrologParserFactory
import it.unibo.tuprolog.core.parsing.toClause

internal class ClausesParserImpl(override val defaultOperatorSet: OperatorSet) : ClausesParser {
    override fun parseClausesLazily(input: String, operators: OperatorSet): Sequence {
        return PrologParserFactory.parseClauses(input, operators)
            .asSequence()
            .map { it.accept(PrologExpressionVisitor()) }
            .map { it.toClause() }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy