at_grammar_induction.git
3 years agoSome notes to explain why we're branching. supergrammar
spatsant [Mon, 13 Jul 2015 15:00:28 +0000]
Some notes to explain why we're branching.

3 years agoSome WIP as the thumb is healing (cure iatrogenic wounds, lvl 1)
stassa [Sun, 12 Jul 2015 19:07:55 +0000]
Some WIP as the thumb is healing (cure iatrogenic wounds, lvl 1)
* Added a start//0 rule to some examples (simple, hand-simulation) to
  model the grammar start symbol. I should reexport this in configuration
  module, making it an error for example modules not to declare it.
* Started implementing a more strict version of that_algorithm. Various
  bits of it in stochastic_supergrammar module: production_score/2
  (reworked), updated_grammar/3, grammar/4, updated_augmentation/2, stuff.
* Also started reworking the adding/clearing of grammar rules to the
  database and adding/clearing terms that keep track of given/ derived
  productions. Still a bit of a pain, much more than it should (oh,
  Prolog...)
* Added all_slices_of/2 and helpers to utilities module, to support
  that_other_algorithm.

3 years agoNew, simple mtg example for that algorithm
stassa [Thu, 2 Jul 2015 20:44:14 +0000]
New, simple mtg example for that algorithm
* This is basically the hand-simulation example from my notes in the hopes
  it will make it easier to figure out what is going on (since I know what
  the results of steps should be) (well ish but).

3 years agoCaught and squished bug in augmented_production/3; added tests.
stassa [Thu, 2 Jul 2015 20:14:44 +0000]
Caught and squished bug in augmented_production/3; added tests.
* There was no test for the case of tt+ --> n | t, so there was no
  augmented_production/3 clause to account for this. The result was that
  an empty variable (for a nonterminal) was added before the terminals
  list. This caused trouble in production_score/2, not to mention that
  it's an illegal augmentation, violating clause"n* t+ --> t".

3 years agoWorking on the main generate_and_test/3 loop; still a WIP
spatsant [Thu, 2 Jul 2015 08:46:37 +0000]
Working on the main generate_and_test/3 loop; still a WIP

3 years agoStarted working on main generate_and_test/0 loop.
spatsant [Tue, 30 Jun 2015 17:41:58 +0000]
Started working on main generate_and_test/0 loop.
* Switched examples to examples_mtg, because it's a bit hard to judge the
  output of the abc language actually? Anyway this is still WIP and will
  need some doing.
* Note I changed derived_production/2 to have it call phrase/3 rather than
  phrase/2 so that it can match rules with a Score variable in a pushback
  list.

3 years agoStarted on the main generate-and-test cycle loop.
stassa [Mon, 29 Jun 2015 21:33:28 +0000]
Started on the main generate-and-test cycle loop.

3 years agoRefactored augmented_production/5 (reordered arguments).
spatsant [Mon, 29 Jun 2015 17:08:12 +0000]
Refactored augmented_production/5 (reordered arguments).

3 years agoPut tests in own file; generated about twice as many as before :D
spatsant [Mon, 29 Jun 2015 17:04:35 +0000]
Put tests in own file; generated about twice as many as before :D
* Removed a redundant clause of augmented_production/5 flagged up by tests
  showing nondeterminism. Power of TDD innit.

3 years agoMade more augmented_production/3 tests pass.
spatsant [Mon, 29 Jun 2015 16:00:34 +0000]
Made more augmented_production/3 tests pass.
* Only tests for verification/ ancestry are left now and I guess those
  will not be easy to implement for most cases but the empty production.

3 years agoRefactored (to simplify) tree_list/2.
spatsant [Mon, 29 Jun 2015 13:38:14 +0000]
Refactored (to simplify) tree_list/2.

3 years agoAdded TODO note to remind myself to do some refactoring.
stassa [Sun, 28 Jun 2015 20:50:25 +0000]
Added TODO note to remind myself to do some refactoring.
* That's in augment_production/3, always.

3 years agoPassed last legal augmentation test; added a rule.
stassa [Sun, 28 Jun 2015 20:47:59 +0000]
Passed last legal augmentation test; added a rule.
* All in augment_production/3. I'll stop here now and continue tomorrow.

3 years agoWoudl you believe I'm still fiddling with stochastic_supergrammar?
stassa [Sun, 28 Jun 2015 20:28:37 +0000]
Woudl you believe I'm still fiddling with stochastic_supergrammar?
* But I cleaned up the logic quite a bit: current productions are now
  passed as terms DCG notation, eg: (a0,[-1] -->g1,g2,[a,b,c]) - and new
  productions are also bound to the output in the same format. Predicates
  further down the pipeline can make sure to call dcg_translate_rule/2 and
  assert the new term. This will probably speed things up also, since I
  avoid calling dcg_translate_rule/2 everytime I augment a production. It
  also saves me a lot of trouble from trying to pick apart and put
  together new rules.
* Also added bunch of tests. Er. Some are actually failing (particularly
  the ones that test for adding terminals to rules without any
  nonterminals.
* Some tests are blocked: those that must fail when a violation of the
  production augmentation logic is caught. Well they are blocked because
  currently nothing tries to catch that sort of thing :D
* Also added tree_list/2 to convert the other way 'round than list_tree/2.
* Also also tried to add a new diff_list/3 predicate to do the thing by
  hand, but it turns out the dcg compiler is faster by a bit (but it could
  be plenty). Whoodathunk it? I need to understand how it works innit.

3 years agoAdded a couple more test cases for augmented_production/3
stassa [Sun, 28 Jun 2015 10:21:37 +0000]
Added a couple more test cases for augmented_production/3
* These are still not totally secure: because I use pushback lists to
  store probabilities ish, it's possible to push just about anything to
  the right side of a rule. Which makes it possible to partially match
  rules (as produced from dcg_translate_rule/2) that aren't quite what I
  meant the augmented production to be. So some nuance is lost there that
  might come back and bite me in the bahoogies at some point.

3 years agoI think I got augmented_production/6 (now) down pat; with tests.
stassa [Sat, 27 Jun 2015 23:32:31 +0000]
I think I got augmented_production/6 (now) down pat; with tests.
* See notes from today. I was doing it wrong (or much more complicated
  than it needed to be anyway).

3 years agoRefactoring augmented_production/3; cleaned up a bit; still a WIP.
stassa [Sat, 27 Jun 2015 12:52:14 +0000]
Refactoring augmented_production/3; cleaned up a bit; still a WIP.

* Also refactored empty_production/2 to bind a [] to the first argument of
  the head of the empty production; that's both to make it explicit that
  it's an empty production and also to avoid issues with unification of
  that argument. More specifically, in clauses of augment_production/3
  that try to call diff_list/3 with this variable to ground it (assuming
  it's a cyclic list) there are Ogres.

3 years agoStruggling with augmented_production/3; added diff_append/3 etc.
spatsant [Fri, 26 Jun 2015 17:50:12 +0000]
Struggling with augmented_production/3; added diff_append/3 etc.

3 years agoRefactored augmented_production/3 (now); still a wip.
stassa [Thu, 25 Jun 2015 20:48:52 +0000]
Refactored augmented_production/3 (now); still a wip.

3 years agoFixed a slight error in augmented_production/4.
stassa [Thu, 25 Jun 2015 16:48:40 +0000]
Fixed a slight error in augmented_production/4.

3 years agoSlight refactorings etc.
stassa [Thu, 25 Jun 2015 15:40:24 +0000]
Slight refactorings etc.

3 years agoAdded pdcg_parse/[2,3] to do duh; also example stochastic dcg.
stassa [Thu, 25 Jun 2015 15:36:40 +0000]
Added pdcg_parse/[2,3] to do duh; also example stochastic dcg.

3 years agoStarted with stochastic version of supergrammar.
stassa.patsantzis [Wed, 24 Jun 2015 17:57:07 +0000]
Started with stochastic version of supergrammar.
* Exported some predicates that will be useful in stochastic_supergrammar
  (from supergrammar).
* And added the new module to the load file.

3 years agoConfiguration changes.
stassa.patsantzis [Wed, 24 Jun 2015 17:18:16 +0000]
Configuration changes.

3 years agoWent back to examples_mtg.pl to experiment with fewer nonterminals.
stassa.patsantzis [Tue, 23 Jun 2015 17:18:12 +0000]
Went back to examples_mtg.pl to experiment with fewer nonterminals.
* Added termianls (but not nonterminals) for destroy, exile and return
  effects.
* Made sure to export nonterminals//0 and terminals//0. Note however that
  this now exports burn//0, cardname//0 and others that will clash with
  exports from examples_mtg_lexicalized and there's nothing I can do about
  it except reexport those in configuration module, which will just kill
  example modules that don't export burn//0 etc. So just restart Prolog
  when you need to change between examples_mtg and
  examples_mtg_lexicalized :)
* Also added a few new examples, for destroy, exile, bounce.
* Ran a bunch of experiments: see notes from today, running for 1_000_000
  inferences nets me lots of productions that parse the same derivations
  over and over. I get lots of burn, not enough bounce etc although those
  effects seem to build up slowly but steadily (eg, I get "return, target,
  creature"... but also "target,player" etc, inevitably). I'll need to add
  an option to add_new_production/3 to keep it from adding a new
  production if it derives the same parses as an existing one- so
  strengthen the semantics of "unique production" really.
* I know you'll forget to change run_demo. before running it when you go
  home. It's currently set to stop at 1,500,000 inferences. Have fun :D

3 years agoAdded option to derivation/4 (now) to control grounding of rule bodies.
stassa.patsantzis [Tue, 23 Jun 2015 14:34:30 +0000]
Added option to derivation/4 (now) to control grounding of rule bodies.

3 years agoRenamed new_rule to new_production etc.
stassa.patsantzis [Tue, 23 Jun 2015 14:04:23 +0000]
Renamed new_rule to new_production etc.

3 years agoRefined names of options for new_rule/4 and bounded_derivation/5.
stassa.patsantzis [Tue, 23 Jun 2015 13:59:11 +0000]
Refined names of options for new_rule/4 and bounded_derivation/5.

3 years agoTokenised corpus slice for effect "destroyed".
stassa [Tue, 23 Jun 2015 00:06:34 +0000]
Tokenised corpus slice for effect "destroyed".

3 years agoSome cleanups; start of stochastic grammar.
stassa.patsantzis [Mon, 22 Jun 2015 18:55:16 +0000]
Some cleanups; start of stochastic grammar.

3 years agoFirst commit after moving out of Experiments; v. alpha I guess :D
spatsant [Mon, 22 Jun 2015 15:55:21 +0000]
First commit after moving out of Experiments; v. alpha I guess :D