Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RuleExecutive + StructuralRules #310

Open
wants to merge 19 commits into
base: master
Choose a base branch
from
Open

RuleExecutive + StructuralRules #310

wants to merge 19 commits into from

Conversation

PtrMan
Copy link
Contributor

@PtrMan PtrMan commented May 30, 2018

Another try to generalize some rules to an format which is easier to modify and understand and document.

  • StructuralRules.structuralCompose1()
  • StructuralRules.structuralDecompose1()

@PtrMan PtrMan added the refactor Code changes that dont fix a bug or add functionality label May 30, 2018
@PtrMan PtrMan requested a review from patham9 May 30, 2018 09:53
Copy link
Member

@patham9 patham9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great! I have an idea of how we can generate code that could be used here. hm let's discuss it before. Maybe we can even allow the rule language and automatically generate code your executive can use? What do you think?

@PtrMan
Copy link
Contributor Author

PtrMan commented May 30, 2018

Had the same idea about codegen - it is a possibility.

@PtrMan
Copy link
Contributor Author

PtrMan commented May 30, 2018

Indeed, the compiler for the rule-language can indeed emit source code. This code describes the inference rules with data structures and lambdas/classes.

The advantage is that it's still possible to modify the rules from the outside at runtime if necessary.

@opennars opennars deleted a comment May 30, 2018
@PtrMan
Copy link
Contributor Author

PtrMan commented May 31, 2018

The unit test fail

/nal/application/toothbrush.nal @11550
OutputContainsCondition OK: [$0.3727;0.0003;0.5886$ (^lighter,{SELF},toothbrush)! %1.00;0.18%]
OutputContainsCondition FAIL: No substring match: (^reshape,{SELF},toothbrush)! %1.00;0.06%
similar(1): (^reshape,{SELF},toothbrush)! %1.00;0.09%
similar(2): (^reshape,{SELF},toothbrush)! %1.00;0.22%
similar(7): (^lighter,{SELF},toothbrush). %1.00;0.06%
similar(8): (^lighter,{SELF},toothbrush)! %1.00;0.12%
similar(13): (^reshape,{SELF},#1). %1.00;0.31%
[ERROR] Tests run: 202, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 145.139 s <<< FAILURE! - in org.opennars.core.NALTest

@opennars opennars deleted a comment May 31, 2018
@opennars opennars deleted a comment May 31, 2018
@PtrMan
Copy link
Contributor Author

PtrMan commented May 31, 2018

Ah I see

@opennars opennars deleted a comment May 31, 2018
@opennars opennars deleted a comment May 31, 2018
@opennars opennars deleted a comment May 31, 2018
@opennars opennars deleted a comment May 31, 2018
@opennars opennars deleted a comment May 31, 2018
@opennars opennars deleted a comment May 31, 2018
@opennars opennars deleted a comment May 31, 2018
@opennars opennars deleted a comment May 31, 2018
@opennars opennars deleted a comment May 31, 2018
@opennars opennars deleted a comment May 31, 2018
@opennars opennars deleted a comment May 31, 2018
@opennars opennars deleted a comment May 31, 2018
@opennars opennars deleted a comment Jun 3, 2018
@opennars opennars deleted a comment Jun 3, 2018
@opennars opennars deleted a comment Jun 3, 2018
@opennars opennars deleted a comment Jun 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Code changes that dont fix a bug or add functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants