Package-level declarations

Types

Link copied to clipboard
class AssignmentView(variable: Var, value: Term, formatter: TermFormatter = TermFormatter.prettyExpressions()) : HBox

An HBox rendering a single variable/value binding (variable = value, formatted via formatter) as used by SolutionView.YesView to list a it.unibo.tuprolog.solve.Solution.Yes's substitution.

Link copied to clipboard
data class CustomTab(val tab: Tab, val modelConfigurator: ModelConfigurator)

A user-defined tab to be added to the tuProlog IDE's side tab pane (see TuPrologIDEBuilder.customTab), paired with a modelConfigurator that is invoked once, when the IDE starts, to let the tab hook itself up to the IDE's TuPrologIDEModel (e.g. subscribing to solver events, or loading extra libraries).

Link copied to clipboard
class FileTabView(file: File, model: TuPrologIDEModel, ideController: TuPrologIDEController, initialText: String = "") : Tab

A Tab hosting a RichTextFX CodeArea editor for a single Prolog file, as added to the IDE's file tab pane by TuPrologIDEController whenever TuPrologIDEModel.onFileLoaded fires. It keeps the model's in-memory copy of the file (see TuPrologIDEModel.setFile) in sync with the editor's text on every keystroke, applies SyntaxColoring to the editor, and forwards caret/keyboard events to ideController so the status bar can be updated.

Link copied to clipboard
class LibraryView(library: Library) : TreeItem<String>

A TreeItem rooted at Library.alias with three children ("Functions", "Predicates", "Operators") listing the indicators of library's primitives/rules, functions, and operators, respectively. Used to populate the IDE's "loaded libraries" tree whenever the solver's it.unibo.tuprolog.solve.library.Runtime changes.

Link copied to clipboard
class ListCellView<T : Any>(viewGenerator: (T) -> Node) : ListCell<T>

A ListCell that delegates rendering to viewGenerator, turning any ListView<T> into a view of arbitrary Nodes instead of plain text; used e.g. for the solutions list (rendered via SolutionView.of) and the warnings list.

Link copied to clipboard
open class Main
https://stackoverflow.
Link copied to clipboard

A callback given a chance to configure a TuPrologIDEModel right after it is created, e.g. to load extra libraries via TuPrologIDEModel.customizeSolver or to pre-populate TuPrologIDEModel.query. Used by TuPrologIDEBuilder.customTab to let a CustomTab wire itself to the IDE's model, and by TuPrologIDEController.customizeModel.

Link copied to clipboard
sealed class SolutionView<T, S : Solution> : VBox

A VBox rendering one it.unibo.tuprolog.solve.Solution as shown in the IDE's solutions list, colored by a "led" Circle (COLOR_YES/COLOR_NO/COLOR_HALT/COLOR_TIMEOUT): a substitution list for Solution.Yes (via AssignmentView), a plain "no" for Solution.No, and either a timeout notice or the exception message plus logic stack trace for Solution.Halt. Use of to build the right concrete subclass for a given solution.

Link copied to clipboard
data class SolverEvent<T>(val event: T, val unificator: Unificator, val operators: OperatorSet, val libraries: Runtime, val flags: FlagStore, val staticKb: Theory, val dynamicKb: Theory, val inputChannels: InputStore, val outputChannels: OutputStore) : ExecutionContextAware

The payload published by every onXxx org.reactfx.EventStream of TuPrologIDEModel: it couples a domain-specific event (e.g. a it.unibo.tuprolog.solve.Solution, a resolution counter, the current goal) with a snapshot of the solver's ExecutionContextAware state (unificator, operators, libraries, flags, staticKb, dynamicKb, inputChannels, outputChannels) taken at the time the event fired.

Link copied to clipboard
class SyntaxColoring(codeArea: CodeArea, delay: Duration = DEFAULT_UPDATE_DELAY, operators: OperatorSet = OperatorSet.DEFAULT, executor: ExecutorService = ForkJoinPool.commonPool())

Regex-based Prolog syntax highlighter for a RichTextFX CodeArea, as used by FileTabView for the editor pane.

Link copied to clipboard
class TuPrologIDEApplication : Application

Standalone JavaFX launcher for the tuProlog IDE: it shows the default TuPrologIDEBuilder configuration on the primary Stage and terminates the JVM when the window closes. Embed the IDE into a bigger application by using TuPrologIDEBuilder directly instead of this class.

Link copied to clipboard
data class TuPrologIDEBuilder(val stage: Stage, var title: String = "tuProlog IDE", var icon: Image = TUPROLOG_LOGO, var onClose: () -> Boolean = { showExitConfirmationDialog(title) }, var onAbout: () -> Unit = { showAboutDialog(title, Info.VERSION) }, var stylesheets: List<String> = listOf(JAVA_KEYWORDS_LIGHT, LIGHT_CODE_AREA), var customLibraries: List<Library> = emptyList(), var customTabs: List<CustomTab> = emptyList())

Fluent entry point for embedding the tuProlog IDE window into a host JavaFX javafx.application.Application: build one (typically as TuPrologIDEBuilder(stage)), customize it via the title/icon/onClose/onAbout/ stylesheets/customLibrar(y|ies)/customTab(s) fluent setters, then call show to load the FXML view, wire it to a fresh TuPrologIDEModel (via TuPrologIDEController), and display stage.

Link copied to clipboard
class TuPrologIDEController : Initializable

The FXML controller (TuPrologIDEView.fxml) backing the main tuProlog IDE window: it owns a private TuPrologIDEModel (created via TuPrologIDEModel.of) and, in initialize, subscribes to every one of its onXxx event streams to keep the file tabs, solutions list, stdout/stderr panes, operators/flags/libraries tables, and static/dynamic knowledge base views up to date; conversely, every @FXML-annotated method reacts to a widget event by calling into the model (e.g. onNextButtonPressed calls TuPrologIDEModel.solve/ TuPrologIDEModel.next). It implements the model/view separation described in TuPrologIDEModel's KDoc.

Link copied to clipboard

The model layer of the tuProlog IDE: it owns the it.unibo.tuprolog.solve.Solver driving the GUI, the set of open in-memory files (a file is just an in-memory String associated to a File handle until saveFile is called), the currently selected query, and the resolution state machine (TuPrologIDEModel.State.IDLE ->TuPrologIDEModel.State.COMPUTING ->TuPrologIDEModel.State.SOLUTION -> ...).

Properties

Link copied to clipboard

External-form URL of the dark-theme code-editor stylesheet.

Link copied to clipboard

External-form URL of the dark-theme keyword/syntax-highlighting stylesheet.

Link copied to clipboard

External-form URL of the light-theme keyword/syntax-highlighting stylesheet (matches SyntaxColoring's style classes).

Link copied to clipboard

External-form URL of the light-theme code-editor stylesheet (fonts, background, line numbers, ...).

Link copied to clipboard
val TUPROLOG_LOGO: Image

The tuProlog logo image, used as the default TuPrologIDEBuilder.icon and in the default "about" dialog.

Functions

Link copied to clipboard
infix fun Regex.and(other: Regex): Regex

The concatenation of the two patterns (this immediately followed by other).

Link copied to clipboard
fun anyOf(regexps: Iterable<Regex>): Regex
fun anyOf(regexps: Sequence<Regex>): Regex

See anyOf.

fun anyOf(vararg regexps: Regex): Regex

A regex matching whatever any of regexps matches (their patterns joined by |).

Link copied to clipboard
fun Regex.asGroup(name: String? = null): Regex

Wraps this pattern in a capturing group, named name if given (as a Java (?<name>...) named group), otherwise anonymous. Named groups are how SyntaxColoring tells which token kind matched.

Link copied to clipboard

Shorthand for wordOf(pattern).

Link copied to clipboard
infix fun Regex.or(other: Regex): Regex

Small regex-composition helpers used by SyntaxColoring to build its combined token-matching pattern out of smaller, independently readable regexes.

Link copied to clipboard
fun wordify(pattern: String): String

Wraps pattern so it only matches at word boundaries, e.g. so "is" does not match inside "this".

Link copied to clipboard
fun wordOf(pattern: String): Regex

A regex matching pattern only when it occurs as a whole word (bounded by \b or string start/end); see wordify.