core-logic

sandbags 2017-05-06T16:48:20.771825Z

I have a problem that I think core.logic might be a fit for. I did some Prolog many moons ago so I've a vague familiarity with this stuff and reading the core.logic tutorial I grasp it, at least at a superficial level. Anyone working with it enough that I can describe what I am doing and they can tell me if it seems like a good fit?

sandbags 2017-05-06T16:54:28.797149Z

Well let me describe it a little, if anyone has a view I can go into more details. The high level problem is to create acronyms (yes this is the stupid side project gone mad) based on a set of rules. An example rule could be must include one of "Strategy" or "Plan" so the word must have an s or a p. Another rule could be must include one of "Technology" or "Digital" ergo a td or d must be present. Another type of rule can include either "Operations" or "Process" means that an o or p could appear if necessary to match a word. So you have a set of rules that govern how letters can be used. Then I smash a dictionary through the rules to create a series of acronyms. Given the rules described above you might have the word sot match as Strategy Operations Technology (this example would use both of the the required rules and the optional rule) and so on. st, ts, tos, tps, and spt are also legal solutions but, since they are not dictionary words, they would never come up. The approach I have taken most recently ended up labelling each letter of the word under test with each of the rules that it can possibly match. It's not hard then to come up with one solution that uses all required labelings (and optional ones if required). But to get all legal solutions for a given word felt like a backtracking type problem and, hence, my interest in core.logic.