ML-KULeuven / problog

ProbLog is a Probabilistic Logic Programming Language for logic programs with probabilities.
https://dtai.cs.kuleuven.be/problog/
307 stars 36 forks source link

Enhancement request: option to put model and examples in the same file #74

Open nathanielvirgo opened 2 years ago

nathanielvirgo commented 2 years ago

For the lfi and similar features, it won't be convenient for every use case to put the examples and the model in separate files. It would be very helpful if there would be an option to put the model and the examples in the same file, e.g. with the format

% model code
---
% example 1
---
% example 2
VincentDerk commented 2 years ago

I prefer to have the examples in separate files myself, but I understand where you're coming from. If you wish to pursue this, regardless of whether we add support for it, you can a write wrapper method very similar to the current one (see also the used read_examples method).