!7 concept Example { S text; bool pos; } concept Theory { S pattern; Cl solvedExamples; } cmodule PatternMaker { switchable S caseID = aGlobalID(); S examplesText, counterexamplesText; transient JTable theoriesTable; transient Concepts cc; start { //cc = dm_handleCaseIDField(); cc = new Concepts; indexConceptFieldCI(cc, Example, 'text); indexConceptFieldCI(cc, Theory, 'pattern); } S _modifyStructForDuplication(S struct) { ret jreplace_first(struct, "caseID=*", "caseID=" + quote(aGlobalID())); } visual withCenteredButtons(jvsplit( jhgrid( jCenteredSection("Examples", dm_textArea examplesText()), jCenteredSection("Counterexamples", dm_textArea counterexamplesText())), jCenteredSection("Theories", theoriesTable = sexyTable())), jThreadedButton("Think", rEnter think)); void think { Set l1 = asLinkedHashSet(tlftj(examplesText)); Set l2 = asLinkedHashSet(tlftj(counterexamplesText)); Set intersection = setIntersection(l1, l2); if (nempty(intersection)) ret with infoBox("Error: Examples appear in both lists, e.g. " + first(intersection)); deleteConcepts(cc, Example); for (S s : l1) uniqCI(cc, Example, text := s, pos := true); for (S s : l2) uniqCI(cc, Example, text := s, pos := false); print("Have " + nExamples(list(cc, Example))); //setField(theories := ai_inputExampleToPossibleMMOPatterns1()); //dataToTable_uneditable_ifHasTable(theoriesTable, map...); } }