coli-saar / alto

Alto, the Algebraic Language Toolkit
Other
16 stars 2 forks source link

Atomic interpretations field for SetAlgebra missing from GUI #40

Closed akoehn closed 6 years ago

akoehn commented 6 years ago

Original report by Nikos Engonopoulos (Bitbucket: engonopoulos, ).


The atomic interpretations field which used to be present on the GUI in the Inputs dialog is now missing. As a result one cannot parse set objects with a grammar for REG (e.g. with reg.irtg in the examples/ directory), because the first order model is always empty.

akoehn commented 6 years ago

Original comment by Martin Villalba (Bitbucket: villalbamartin, GitHub: villalbamartin).


Some extra details on this issue:

The code for parsing a set object looks a bit like this:

#!java
TemplateIrtgInputCodec input_codec = new TemplateIrtgInputCodec();
TemplateInterpretedTreeAutomaton automaton = input_codec.read(tirtg);

FirstOrderModel fomodel = FirstOrderModel.read(new StringReader(model));
InterpretedTreeAutomaton ita = automaton.instantiate(fomodel);

((SetAlgebra)ita.getInterpretation("sem").getAlgebra()).setModel(fomodel);

HashMap<String, String> mymap = new HashMap<>();
mymap.put("sem", "{lr11}");
TreeAutomaton tree = ita.parse(mymap);

The problem is that the fifth instruction is no longer available via the GUI - there used to be a text field where one could paste the model, but this is now gone.

A final thought: I have never needed to use a different model for this missing step. I think it could be useful if, besides the text field, there was also a checkbox saying "use the same model" that doesn't require to paste the same code twice.

akoehn commented 6 years ago

Original comment by Nikos Engonopoulos (Bitbucket: engonopoulos, ).


I fixed it in the last commit

akoehn commented 6 years ago

Original changes by Nikos Engonopoulos (Bitbucket: engonopoulos, ).


changed state from "new" to "resolved"