opencog / asmoses

MOSES Machine Learning: Meta-Optimizing Semantic Evolutionary Search for the AtomSpace (https://github.com/opencog/atomspace)
https://wiki.opencog.org/w/Meta-Optimizing_Semantic_Evolutionary_Search
Other
39 stars 31 forks source link

Port Reduct #21

Open kasimebrahim opened 6 years ago

kasimebrahim commented 6 years ago

As suggested in issue #3, In order to proceed to porting other subsystems we choose to wrap the existing Combo reduct engine. Given a program P to be reduced, first we want to convert P to a combo::tree CP and reduce it using reduct to CP_reduced then convert it back to Atomese P_reduced. Finally we need to store it in ReductLink, ReductLink can be

 REDUCT_LINK <- ORDERED_LINK "ReductLink"
(ReductLink
    (Schema "Rule")
    (Schema "P")
    (Schema "P_reduced"))

or just

(ReductLink
    (Schema "P")
    (Schema "P_reduced"))
masrb commented 6 years ago

I think according to issue #3 , it is


(ReductLink
  (And
    (Predicate "f1")
    (Predicate "f1"))
  (Predicate "f1")))
linas commented 5 years ago

Several remarks:

The upshot is -- you do not need ReductLink. You just need to write some reduction rules, and let the pattern matcher do the job it was designed to do.

Yes, this is easy to say, and maybe harder to do. You should start out by writing few simple rules, and see how it goes. I'm here to help.

ngeiswei commented 5 years ago

@linas,

ReductLink
   A
   B

would not reduce but just indicate that expression B is reduced form of expression A.

We need to keep track of that because some reductions are defined recursively, such "if B1 is the reduced form of A1 and B2 is the reduced form of A2, then D = blahblah of B1 and B2 is the reduced form of C = blahblah of A1 and A2".

The plan is indeed to have the URE performs the reduction (forward and backward chainer should be possible).

ngeiswei commented 5 years ago

The ReductLink name is not set in stone, just till we find the actual name. The fact that it trumped you indicates we do need a better one. Note that we don't need a new link type we can use

Evaluation
  Predicate "is-reduction-of"
  List
    A
    B

but since it is gonna be used quite extensively a dedicated link sounds appropriate, though for starter we can probably go with an EvaluationLink.

ngeiswei commented 5 years ago

Maybe a better link name would be ReducedToLink.

linas commented 5 years ago

OH, OK. I'm pretty certain you want to assign them to named classes, and limit reduct so that it works only with the provided classes (instead of any old link it can find in the atomspace). The classic moses ones were "arithmetic" and "propositional logic". but there are many more: "linear algebra" is popular for "linear programming problems", and integer algebras are popular for "discrete linear programming", and then there are dozens? hundreds? of different kinds of modal logics, each with it's own set of reduction rules.

linas commented 4 years ago

See also issue #66 for more about arithmetic functions