• R/O
  • SSH
  • HTTPS

adp: Commit


Commit MetaInfo

Revisión308 (tree)
Tiempo2012-06-08 17:18:08
Autorohfuji

Log Message

repayの実装

Cambiar Resumen

Diferencia incremental

--- trunk/adp_unify.cpp (revision 307)
+++ trunk/adp_unify.cpp (revision 308)
@@ -92,6 +92,36 @@
9292 return true;
9393 }
9494
95+template <class V, class T> bool __forceinline vrepay_h_g(const V &horn, const T &goal, ExecContext *c, VLocal *hlocal) __attribute__((always_inline));
96+template <class V, class T> bool __forceinline vrepay_h_g(const V &horn, const T &goal, ExecContext *c, VLocal *hlocal)
97+{
98+ const PObject *item = (*hlocal)[horn.idx];
99+ if ( item == 0 ) {
100+ // 代入しても無意味
101+ return true;
102+ } else {
103+ return item->repay_h_g(goal, c);
104+ }
105+ return true;
106+}
107+
108+template <class V, class T> bool __forceinline vrepay_g_h(const V &goal, const T &horn, ExecContext *c, VLocal *glocal) __attribute__((always_inline));
109+template <class V, class T> bool __forceinline vrepay_g_h(const V &goal, const T &horn, ExecContext *c, VLocal *glocal)
110+{
111+ const PObject *item = (*glocal)[goal.idx];
112+ if ( item == 0 ) {
113+ if ( c->goal->nobacktrack ) {
114+ (*glocal)[goal.idx] = horn.clone(&c->p->objs);
115+ } else {
116+ (*glocal)[goal.idx] = &horn;
117+ }
118+ return true;
119+ } else {
120+ return item->repay_g_h(horn, c);
121+ }
122+ return true;
123+}
124+
95125 template <class V, class T> bool __forceinline vunify_getval(const V &goal, const T &horn, ExecContextRoot *c, VLocal *glocal, VLocal *hlocal) __attribute__((always_inline));
96126 template <class V, class T> bool __forceinline vunify_getval(const V &goal, const T &horn, ExecContextRoot *c, VLocal *glocal, VLocal *hlocal)
97127 {
@@ -142,6 +172,37 @@
142172 return true;
143173 }
144174
175+template <class V, class T> bool __forceinline vrepay_getval_h_g(const V &horn, const T &goal, ExecContext *c, VLocal *hlocal) __attribute__((always_inline));
176+template <class V, class T> bool __forceinline vrepay_getval_h_g(const V &horn, const T &goal, ExecContext *c, VLocal *hlocal)
177+{
178+ const PObject *item = (*hlocal)[horn.idx];
179+ if ( item == 0 ) {
180+ // 代入しても無意味
181+ return true;
182+ } else {
183+ return item->repay_h_g( goal, c);
184+ }
185+ return true;
186+}
187+
188+template <class V, class T> bool __forceinline vrepay_getval_g_h(const V &goal, const T &horn, ExecContext *c, VLocal *glocal) __attribute__((always_inline));
189+template <class V, class T> bool __forceinline vrepay_getval_g_h(const V &goal, const T &horn, ExecContext *c, VLocal *glocal)
190+{
191+ const PObject *item = (*glocal)[goal.idx];
192+ if ( item == 0 ) {
193+ const PObject *p = horn.getval2(c, c->hl);
194+ if ( c->goal->nobacktrack ) {
195+ p = p->clone(&c->p->objs);
196+ }
197+ (*glocal)[goal.idx] = p;
198+ return true;
199+ } else {
200+ return item->repay_g_h( horn, c);
201+ }
202+ return true;
203+}
204+
205+
145206 template <class V, class T> bool __forceinline vunify_ver(const V &goal, const T &horn, ExecContextRoot *c, VLocal *glocal, VLocal *hlocal) __attribute__((always_inline));
146207 template <class V, class T> bool __forceinline vunify_ver(const V &goal, const T &horn, ExecContextRoot *c, VLocal *glocal, VLocal *hlocal)
147208 {
@@ -191,6 +252,29 @@
191252 return true;
192253 }
193254
255+template <class V, class T> bool __forceinline vrepay_ver_g_h(const V &goal, const T &horn, ExecContext *c, VLocal *glocal, VLocal *hlocal) __attribute__((always_inline));
256+template <class V, class T> bool __forceinline vrepay_ver_g_h(const V &goal, const T &horn, ExecContext *c, VLocal *glocal, VLocal *hlocal)
257+{
258+ const PObject *gval = (*glocal)[goal.idx];
259+ const PObject *hval = (*hlocal)[horn.idx];
260+ if ( gval != 0 ) {
261+ if ( hval != 0 ) {
262+ return hval->repay_h_g( *gval, c);
263+ } else {
264+ // 代入は無意味
265+ return true;
266+ }
267+ } else if ( hval != 0 ) {
268+ const PObject *p = hval->getval2(c, c->hl);
269+ if ( c->goal->nobacktrack ) {
270+ p = p->clone(&c->p->objs);
271+ }
272+ (*glocal)[goal.idx] = p;
273+ return true;
274+ }
275+ return true;
276+}
277+
194278 /*************************************** PNil ******************************************/
195279 bool PNil::unify(const PObject &goal, ExecContextRoot *c, VLocal *hlocal, VLocal *glocal) const { return goal.unify(*this, c, glocal, hlocal); }
196280 bool PNil::unify(const PNil &horn, ExecContextRoot *c, VLocal *glocal, VLocal *hlocal) const { return true; }
@@ -213,6 +297,16 @@
213297 bool PNil::match_g_h(const PVeriable &horn, ExecContext *c) const { return vmatch_h_g(horn, *this, c, c->hl); }
214298 bool PNil::match_g_h(const PEVeriable &horn, ExecContext *c) const { return vmatch_h_g(horn, *this, c, horn.vl); }
215299
300+bool PNil::repay_h_g(const PObject &goal, ExecContext *c) const { return goal.repay_g_h(*this, c); }
301+bool PNil::repay_h_g(const PNil &goal, ExecContext *c) const { return true; }
302+bool PNil::repay_h_g(const PList &goal, ExecContext *c) const { return goal.repay_g_h( *this, c); }
303+bool PNil::repay_h_g(const PVeriable &goal, ExecContext *c) const { return vrepay_g_h(goal, *this, c, c->hl); }
304+bool PNil::repay_h_g(const PEVeriable &goal, ExecContext *c) const { return vrepay_g_h(goal, *this, c, goal.vl); }
305+bool PNil::repay_g_h(const PNil &horn, ExecContext *c) const { return true; }
306+bool PNil::repay_g_h(const PList &horn, ExecContext *c) const { return horn.repay_h_g( *this, c); }
307+bool PNil::repay_g_h(const PVeriable &horn, ExecContext *c) const { return vrepay_h_g(horn, *this, c, c->hl); }
308+bool PNil::repay_g_h(const PEVeriable &horn, ExecContext *c) const { return vrepay_h_g(horn, *this, c, horn.vl); }
309+
216310 /*************************************** PString ******************************************/
217311 bool PString::unify(const PObject &goal, ExecContextRoot *c, VLocal *hlocal, VLocal *glocal) const { return goal.unify(*this, c, glocal, hlocal); }
218312 bool PString::unify(const PString &horn, ExecContextRoot *c, VLocal *glocal, VLocal *hlocal) const { return strcmp( value.c_str(), horn.value.c_str()) == 0; }
@@ -231,6 +325,14 @@
231325 bool PString::match_g_h(const PVeriable &horn, ExecContext *c) const { return vmatch_h_g(horn, *this, c, c->hl); }
232326 bool PString::match_g_h(const PEVeriable &horn, ExecContext *c) const{ return vmatch_h_g(horn, *this, c, horn.vl); }
233327
328+bool PString::repay_h_g(const PObject &goal, ExecContext *c) const { return goal.repay_g_h(*this, c); }
329+bool PString::repay_h_g(const PString &goal, ExecContext *c) const { return strcmp( value.c_str(), goal.value.c_str()) == 0; }
330+bool PString::repay_h_g(const PVeriable &goal, ExecContext *c) const { return vrepay_g_h(goal, *this, c, c->hl); }
331+bool PString::repay_h_g(const PEVeriable &goal, ExecContext *c) const { return vrepay_g_h(goal, *this, c, goal.vl); }
332+bool PString::repay_g_h(const PString &horn, ExecContext *c) const { return strcmp( value.c_str(), horn.value.c_str()) == 0; }
333+bool PString::repay_g_h(const PVeriable &horn, ExecContext *c) const { return vrepay_h_g(horn, *this, c, c->hl); }
334+bool PString::repay_g_h(const PEVeriable &horn, ExecContext *c) const{ return vrepay_h_g(horn, *this, c, horn.vl); }
335+
234336 /*************************************** PDouble ******************************************/
235337 bool PDouble::unify(const PObject &goal, ExecContextRoot *c, VLocal *hlocal, VLocal *glocal) const { return goal.unify(*this, c, glocal, hlocal); }
236338 bool PDouble::unify(const PDouble &horn, ExecContextRoot *c, VLocal *glocal, VLocal *hlocal) const { return fabs(value - (double)horn.value) < DBL_EPSILON; }
@@ -254,6 +356,15 @@
254356 bool PDouble::match_g_h(const PVeriable &horn, ExecContext *c) const { return vmatch_h_g(horn, *this, c, c->hl); }
255357 bool PDouble::match_g_h(const PEVeriable &horn, ExecContext *c) const { return vmatch_h_g(horn, *this, c, horn.vl); }
256358
359+bool PDouble::repay_h_g(const PObject &goal, ExecContext *c) const { return goal.repay_g_h(*this, c); }
360+bool PDouble::repay_h_g(const PDouble &goal, ExecContext *c) const { return fabs(value - (double)goal.value) < DBL_EPSILON; }
361+bool PDouble::repay_h_g(const PInteger &goal, ExecContext *c) const { return fabs(value - (double)goal.value) < DBL_EPSILON; }
362+bool PDouble::repay_h_g(const PVeriable &goal, ExecContext *c) const { return vrepay_g_h(goal, *this, c, c->hl); }
363+bool PDouble::repay_h_g(const PEVeriable &goal, ExecContext *c) const { return vrepay_g_h(goal, *this, c, goal.vl); }
364+bool PDouble::repay_g_h(const PDouble &horn, ExecContext *c) const { return fabs(value - (double)horn.value) < DBL_EPSILON; }
365+bool PDouble::repay_g_h(const PInteger &horn, ExecContext *c) const { return fabs(value - (double)horn.value) < DBL_EPSILON; }
366+bool PDouble::repay_g_h(const PVeriable &horn, ExecContext *c) const { return vrepay_h_g(horn, *this, c, c->hl); }
367+bool PDouble::repay_g_h(const PEVeriable &horn, ExecContext *c) const { return vrepay_h_g(horn, *this, c, horn.vl); }
257368
258369 /*************************************** PInteger ******************************************/
259370 bool PInteger::unify(const PObject &goal, ExecContextRoot *c, VLocal *hlocal, VLocal *glocal) const { return goal.unify(*this, c, glocal, hlocal); }
@@ -278,6 +389,16 @@
278389 bool PInteger::match_g_h(const PVeriable &horn, ExecContext *c) const { return vmatch_h_g(horn, *this, c, c->hl); }
279390 bool PInteger::match_g_h(const PEVeriable &horn, ExecContext *c) const { return vmatch_h_g(horn, *this, c, horn.vl); }
280391
392+bool PInteger::repay_h_g(const PObject &goal, ExecContext *c) const { return goal.repay_g_h(*this, c); }
393+bool PInteger::repay_h_g(const PDouble &goal, ExecContext *c) const { return fabs(value - (double)goal.value) < DBL_EPSILON; }
394+bool PInteger::repay_h_g(const PInteger &goal, ExecContext *c) const { return value == goal.value; }
395+bool PInteger::repay_h_g(const PVeriable &goal, ExecContext *c) const { return vrepay_g_h(goal, *this, c, c->hl); }
396+bool PInteger::repay_h_g(const PEVeriable &goal, ExecContext *c) const { return vrepay_g_h(goal, *this, c, goal.vl); }
397+bool PInteger::repay_g_h(const PDouble &horn, ExecContext *c) const { return fabs(value - (double)horn.value) < DBL_EPSILON; }
398+bool PInteger::repay_g_h(const PInteger &horn, ExecContext *c) const { return value == horn.value; }
399+bool PInteger::repay_g_h(const PVeriable &horn, ExecContext *c) const { return vrepay_h_g(horn, *this, c, c->hl); }
400+bool PInteger::repay_g_h(const PEVeriable &horn, ExecContext *c) const { return vrepay_h_g(horn, *this, c, horn.vl); }
401+
281402 /*************************************** PList ******************************************/
282403 static __forceinline bool PList_unify(const PList &list) __attribute__((always_inline));
283404 static __forceinline bool PList_unify(const PList &list)
@@ -299,6 +420,12 @@
299420 return false;
300421 }
301422
423+static __forceinline bool PList_repay(const PList &goal, const PList &horn, ExecContext *c) __attribute__((always_inline));
424+static __forceinline bool PList_repay(const PList &goal, const PList &horn, ExecContext *c)
425+{
426+ if ( horn.lvalue->repay_h_g( *goal.lvalue, c) && horn.rvalue->repay_h_g( *goal.rvalue, c) ) return true;
427+ return false;
428+}
302429
303430 bool PList::unify(const PObject &goal, ExecContextRoot *c, VLocal *hlocal, VLocal *glocal) const { return goal.unify(*this, c, glocal, hlocal); }
304431 bool PList::unify(const PNil &horn, ExecContextRoot *c, VLocal *glocal, VLocal *hlocal) const { return PList_unify(*this); }
@@ -321,6 +448,16 @@
321448 bool PList::match_g_h(const PVeriable &horn, ExecContext *c) const { return vmatch_getval_h_g(horn, *this, c, c->hl); }
322449 bool PList::match_g_h(const PEVeriable &horn, ExecContext *c) const { return vmatch_getval_h_g(horn, *this, c, horn.vl); }
323450
451+bool PList::repay_h_g(const PObject &goal, ExecContext *c) const { return goal.repay_g_h(*this, c); }
452+bool PList::repay_h_g(const PNil &goal, ExecContext *c) const { return PList_unify( *this); }
453+bool PList::repay_h_g(const PList &goal, ExecContext *c) const { return PList_repay( goal, *this, c); }
454+bool PList::repay_h_g(const PVeriable &goal, ExecContext *c) const { return vrepay_getval_g_h(goal, *this, c, c->hl); }
455+bool PList::repay_h_g(const PEVeriable &goal, ExecContext *c) const { return vrepay_getval_g_h(goal, *this, c, goal.vl); }
456+bool PList::repay_g_h(const PNil &horn, ExecContext *c) const { return PList_unify( *this); }
457+bool PList::repay_g_h(const PList &horn, ExecContext *c) const { return PList_repay( *this, horn, c); }
458+bool PList::repay_g_h(const PVeriable &horn, ExecContext *c) const { return vrepay_getval_h_g(horn, *this, c, c->hl); }
459+bool PList::repay_g_h(const PEVeriable &horn, ExecContext *c) const { return vrepay_getval_h_g(horn, *this, c, horn.vl); }
460+
324461 /*************************************** PArray ******************************************/
325462 static __forceinline bool PArray_unify(const PArray &goal, const PArray &horn, ExecContextRoot *c, VLocal *glocal, VLocal *hlocal) __attribute__((always_inline));
326463 static __forceinline bool PArray_unify(const PArray &goal, const PArray &horn, ExecContextRoot *c, VLocal *glocal, VLocal *hlocal)
@@ -424,6 +561,57 @@
424561 return true;
425562 }
426563
564+static __forceinline bool PArray_repay(const PArray &goal, const PArray &horn, ExecContext *c) __attribute__((always_inline));
565+static __forceinline bool PArray_repay(const PArray &goal, const PArray &horn, ExecContext *c)
566+{
567+ size_t gsiz = goal.value.size();
568+ size_t hsiz = horn.value.size();
569+
570+ c->ao = 0;
571+ // 引数の数が同じ場合
572+ if ( gsiz == hsiz ) {
573+ for ( size_t i = 0; i < gsiz; i++ ) {
574+ c->uidx = i;
575+ if ( !horn.value[i]->repay_h_g( *goal.value[i], c) ) {
576+ return false;
577+ }
578+ }
579+ } else if ( gsiz < hsiz && goal.args == true && horn.args == false ) {
580+ // 引数の数が異なる場合、片方に@がある場合、可変長引数の対応を行う。
581+ size_t m = gsiz - 1;
582+ // @変数の前まで普通にマッチングさせる
583+ for ( size_t i = 0; i < m; i++ ) {
584+ c->uidx = i;
585+ if ( !horn.value[i]->repay_h_g( *goal.value[i], c) ) {
586+ return false;
587+ }
588+ }
589+ // @用の配列を作成する
590+ c->uidx = m;
591+ c->ao = pmm.newPArray(c->pobjs, horn, m, hsiz);
592+ return goal.value[m]->repay_g_h( *c->ao, c);
593+
594+ } else if ( gsiz > hsiz && goal.args == false && horn.args == true ) {
595+ // 引数の数が異なる場合、片方に@がある場合、可変長引数の対応を行う。
596+ size_t m = hsiz - 1;
597+ // @変数の前まで普通にマッチングさせる
598+ for ( size_t i = 0; i < m; i++ ) {
599+ c->uidx = i;
600+ if ( !horn.value[i]->repay_h_g( *goal.value[i], c) ) {
601+ return false;
602+ }
603+ }
604+ // @用の配列を作成する
605+ c->uidx = m;
606+ c->ao = pmm.newPArray(c->pobjs, goal, m, gsiz);
607+ return horn.value[m]->repay_h_g( *c->ao, c);
608+ } else {
609+ return false;
610+ }
611+
612+ return true;
613+}
614+
427615 bool PArray::unify(const PObject &goal, ExecContextRoot *c, VLocal *hlocal, VLocal *glocal) const { return goal.unify(*this, c, glocal, hlocal); }
428616 bool PArray::unify(const PNil &horn, ExecContextRoot *c, VLocal *glocal, VLocal *hlocal) const { if ( value.empty() ) return true; return false; }
429617 bool PArray::unify(const PArray &horn, ExecContextRoot *c, VLocal *glocal, VLocal *hlocal) const { return PArray_unify( *this, horn, c, glocal, hlocal); }
@@ -445,6 +633,16 @@
445633 bool PArray::match_g_h(const PVeriable &horn, ExecContext *c) const { return vmatch_getval_h_g(horn, *this, c, c->hl); }
446634 bool PArray::match_g_h(const PEVeriable &horn, ExecContext *c) const { return vmatch_getval_h_g(horn, *this, c, horn.vl); }
447635
636+bool PArray::repay_h_g(const PObject &goal, ExecContext *c) const { return goal.repay_g_h(*this, c); }
637+bool PArray::repay_h_g(const PNil &goal, ExecContext *c) const { if ( value.empty() ) return true; return false; }
638+bool PArray::repay_h_g(const PArray &goal, ExecContext *c) const { return PArray_repay( goal, *this, c); }
639+bool PArray::repay_h_g(const PVeriable &goal, ExecContext *c) const { return vrepay_getval_g_h(goal, *this, c, c->hl); }
640+bool PArray::repay_h_g(const PEVeriable &goal, ExecContext *c) const { return vrepay_getval_g_h(goal, *this, c, goal.vl); }
641+bool PArray::repay_g_h(const PNil &horn, ExecContext *c) const { if ( value.empty() ) return true; return false; }
642+bool PArray::repay_g_h(const PArray &horn, ExecContext *c) const { return PArray_repay( *this, horn, c); }
643+bool PArray::repay_g_h(const PVeriable &horn, ExecContext *c) const { return vrepay_getval_h_g(horn, *this, c, c->hl); }
644+bool PArray::repay_g_h(const PEVeriable &horn, ExecContext *c) const { return vrepay_getval_h_g(horn, *this, c, horn.vl); }
645+
448646 /*************************************** PPredicate ******************************************/
449647 static __forceinline bool PPredicate_unify(const PPredicate &goal, const PPredicate &horn, ExecContextRoot *c, VLocal *glocal, VLocal *hlocal) __attribute__((always_inline));
450648 static __forceinline bool PPredicate_unify(const PPredicate &goal, const PPredicate &horn, ExecContextRoot *c, VLocal *glocal, VLocal *hlocal)
@@ -466,6 +664,16 @@
466664 return goal.arglist.match_g_h( horn.arglist, c); // horn.arglistがPObjectでない場合はこのように呼び出す
467665 }
468666
667+static __forceinline bool PPredicate_repay(const PPredicate &goal, const PPredicate &horn, ExecContext *c) __attribute__((always_inline));
668+static __forceinline bool PPredicate_repay(const PPredicate &goal, const PPredicate &horn, ExecContext *c)
669+{
670+ // 呼び出し側(goal)がnamespaceを指定した場合、namespaceが一致している必要がある。
671+ if ( !goal.nspace.empty() && strcmp( horn.nspace.c_str(), goal.nspace.c_str()) != 0 ) { return false; }
672+
673+ if ( !horn.name->repay_h_g( *goal.name, c) ) { return false; }
674+ return goal.arglist.repay_g_h( horn.arglist, c); // horn.arglistがPObjectでない場合はこのように呼び出す
675+}
676+
469677 bool PPredicate::unify(const PObject &goal, ExecContextRoot *c, VLocal *hlocal, VLocal *glocal) const { return goal.unify(*this, c, glocal, hlocal); }
470678 bool PPredicate::unify(const PPredicate &horn, ExecContextRoot *c, VLocal *glocal, VLocal *hlocal) const { return PPredicate_unify( *this, horn, c, glocal, hlocal); }
471679 bool PPredicate::unify(const PVeriable &horn, ExecContextRoot *c, VLocal *glocal, VLocal *hlocal) const { return vunify_getval(horn, *this, c, hlocal, glocal); }
@@ -483,6 +691,14 @@
483691 bool PPredicate::match_g_h(const PVeriable &horn, ExecContext *c) const { return vmatch_getval_h_g(horn, *this, c, c->hl); }
484692 bool PPredicate::match_g_h(const PEVeriable &horn, ExecContext *c) const { return vmatch_getval_h_g(horn, *this, c, horn.vl); }
485693
694+bool PPredicate::repay_h_g(const PObject &goal, ExecContext *c) const { return goal.repay_g_h(*this, c); }
695+bool PPredicate::repay_h_g(const PPredicate &goal, ExecContext *c) const { return PPredicate_repay( goal, *this, c); }
696+bool PPredicate::repay_h_g(const PVeriable &goal, ExecContext *c) const { return vrepay_getval_g_h(goal, *this, c, c->hl); }
697+bool PPredicate::repay_h_g(const PEVeriable &goal, ExecContext *c) const { return vrepay_getval_g_h(goal, *this, c, goal.vl); }
698+bool PPredicate::repay_g_h(const PPredicate &horn, ExecContext *c) const { return PPredicate_repay( *this, horn, c); }
699+bool PPredicate::repay_g_h(const PVeriable &horn, ExecContext *c) const { return vrepay_getval_h_g(horn, *this, c, c->hl); }
700+bool PPredicate::repay_g_h(const PEVeriable &horn, ExecContext *c) const { return vrepay_getval_h_g(horn, *this, c, horn.vl); }
701+
486702 /*************************************** PVeriable ******************************************/
487703 bool PVeriable::unify(const PObject &goal, ExecContextRoot *c, VLocal *hlocal, VLocal *glocal) const { return goal.unify(*this, c, glocal, hlocal); }
488704 bool PVeriable::unify(const PNil &horn, ExecContextRoot *c, VLocal *glocal, VLocal *hlocal) const { return vunify(*this, horn, c, glocal, hlocal); }
@@ -525,6 +741,26 @@
525741 bool PVeriable::match_g_h(const PVeriable &horn, ExecContext *c) const { return vmatch_ver_g_h(*this, horn, c, c->gl, c->hl); }
526742 bool PVeriable::match_g_h(const PEVeriable &horn, ExecContext *c) const { return vmatch_ver_g_h(*this, horn, c, c->gl, horn.vl); }
527743
744+bool PVeriable::repay_h_g(const PObject &goal, ExecContext *c) const { return goal.repay_g_h(*this, c); }
745+bool PVeriable::repay_h_g(const PNil &goal, ExecContext *c) const { return vrepay_h_g(*this, goal, c, c->hl); }
746+bool PVeriable::repay_h_g(const PString &goal, ExecContext *c) const { return vrepay_h_g(*this, goal, c, c->hl); }
747+bool PVeriable::repay_h_g(const PDouble &goal, ExecContext *c) const { return vrepay_h_g(*this, goal, c, c->hl); }
748+bool PVeriable::repay_h_g(const PInteger &goal, ExecContext *c) const { return vrepay_h_g(*this, goal, c, c->hl); }
749+bool PVeriable::repay_h_g(const PList &goal, ExecContext *c) const { return vrepay_getval_h_g(*this, goal, c, c->hl); }
750+bool PVeriable::repay_h_g(const PArray &goal, ExecContext *c) const { return vrepay_getval_h_g(*this, goal, c, c->hl); }
751+bool PVeriable::repay_h_g(const PPredicate &goal, ExecContext *c) const { return vrepay_getval_h_g(*this, goal, c, c->hl); }
752+bool PVeriable::repay_h_g(const PVeriable &goal, ExecContext *c) const { return vrepay_ver_g_h(goal, *this, c, c->gl, c->hl); }
753+bool PVeriable::repay_h_g(const PEVeriable &goal, ExecContext *c) const { return vrepay_ver_g_h(goal, *this, c, goal.vl, c->hl); }
754+bool PVeriable::repay_g_h(const PNil &horn, ExecContext *c) const { return vrepay_g_h(*this, horn, c, c->gl); }
755+bool PVeriable::repay_g_h(const PString &horn, ExecContext *c) const { return vrepay_g_h(*this, horn, c, c->gl); }
756+bool PVeriable::repay_g_h(const PDouble &horn, ExecContext *c) const { return vrepay_g_h(*this, horn, c, c->gl); }
757+bool PVeriable::repay_g_h(const PInteger &horn, ExecContext *c) const { return vrepay_g_h(*this, horn, c, c->gl); }
758+bool PVeriable::repay_g_h(const PList &horn, ExecContext *c) const { return vrepay_getval_g_h(*this, horn, c, c->gl); }
759+bool PVeriable::repay_g_h(const PArray &horn, ExecContext *c) const { return vrepay_getval_g_h(*this, horn, c, c->gl); }
760+bool PVeriable::repay_g_h(const PPredicate &horn, ExecContext *c) const { return vrepay_getval_g_h(*this, horn, c, c->gl); }
761+bool PVeriable::repay_g_h(const PVeriable &horn, ExecContext *c) const { return vrepay_ver_g_h(*this, horn, c, c->gl, c->hl); }
762+bool PVeriable::repay_g_h(const PEVeriable &horn, ExecContext *c) const { return vrepay_ver_g_h(*this, horn, c, c->gl, horn.vl); }
763+
528764 /*************************************** PEVeriable ******************************************/
529765 bool PEVeriable::unify(const PObject &goal, ExecContextRoot *c, VLocal *hlocal, VLocal *glocal) const { return goal.unify(*this, c, glocal, hlocal); }
530766 bool PEVeriable::unify(const PNil &horn, ExecContextRoot *c, VLocal *, VLocal *hlocal) const { return vunify(*this, horn, c, vl, hlocal); }
@@ -567,6 +803,25 @@
567803 bool PEVeriable::match_g_h(const PVeriable &horn, ExecContext *c) const { return vmatch_ver_g_h(*this, horn, c, vl, c->hl); }
568804 bool PEVeriable::match_g_h(const PEVeriable &horn, ExecContext *c) const { return vmatch_ver_g_h(*this, horn, c, vl, horn.vl); }
569805
806+bool PEVeriable::repay_h_g(const PObject &goal, ExecContext *c) const { return goal.repay_g_h(*this, c); }
807+bool PEVeriable::repay_h_g(const PNil &goal, ExecContext *c) const { return vrepay_h_g(*this, goal, c, vl); }
808+bool PEVeriable::repay_h_g(const PString &goal, ExecContext *c) const { return vrepay_h_g(*this, goal, c, vl); }
809+bool PEVeriable::repay_h_g(const PDouble &goal, ExecContext *c) const { return vrepay_h_g(*this, goal, c, vl); }
810+bool PEVeriable::repay_h_g(const PInteger &goal, ExecContext *c) const { return vrepay_h_g(*this, goal, c, vl); }
811+bool PEVeriable::repay_h_g(const PList &goal, ExecContext *c) const { return vrepay_getval_h_g(*this, goal, c, vl); }
812+bool PEVeriable::repay_h_g(const PArray &goal, ExecContext *c) const { return vrepay_getval_h_g(*this, goal, c, vl); }
813+bool PEVeriable::repay_h_g(const PPredicate &goal, ExecContext *c) const { return vrepay_getval_h_g(*this, goal, c, vl); }
814+bool PEVeriable::repay_h_g(const PVeriable &goal, ExecContext *c) const { return vrepay_ver_g_h(goal, *this, c, c->gl, vl); }
815+bool PEVeriable::repay_h_g(const PEVeriable &goal, ExecContext *c) const { return vrepay_ver_g_h(goal, *this, c, goal.vl, vl); }
816+bool PEVeriable::repay_g_h(const PNil &horn, ExecContext *c) const { return vrepay_g_h(*this, horn, c, vl); }
817+bool PEVeriable::repay_g_h(const PString &horn, ExecContext *c) const { return vrepay_g_h(*this, horn, c, vl); }
818+bool PEVeriable::repay_g_h(const PDouble &horn, ExecContext *c) const { return vrepay_g_h(*this, horn, c, vl); }
819+bool PEVeriable::repay_g_h(const PInteger &horn, ExecContext *c) const { return vrepay_g_h(*this, horn, c, vl); }
820+bool PEVeriable::repay_g_h(const PList &horn, ExecContext *c) const { return vrepay_getval_g_h(*this, horn, c, vl); }
821+bool PEVeriable::repay_g_h(const PArray &horn, ExecContext *c) const { return vrepay_getval_g_h(*this, horn, c, vl); }
822+bool PEVeriable::repay_g_h(const PPredicate &horn, ExecContext *c) const { return vrepay_getval_g_h(*this, horn, c, vl); }
823+bool PEVeriable::repay_g_h(const PVeriable &horn, ExecContext *c) const { return vrepay_ver_g_h(*this, horn, c, vl, c->hl); }
824+bool PEVeriable::repay_g_h(const PEVeriable &horn, ExecContext *c) const { return vrepay_ver_g_h(*this, horn, c, vl, horn.vl); }
570825 /*************************************** getval ******************************************/
571826 const PObject *PList::getval( ExecContextRoot *c) const
572827 {
--- trunk/adp_compile.h (revision 307)
+++ trunk/adp_compile.h (revision 308)
@@ -195,6 +195,29 @@
195195 virtual bool match_g_h(const PEVeriable &horn, ExecContext *c) const { return false; }
196196 virtual bool match_g_h(const PWildCard &horn, ExecContext *c) const { return true; }
197197
198+ // execute後の戻り値の設定
199+ virtual bool repay_h_g(const PObject &goal, ExecContext *c) const { return false; }
200+ virtual bool repay_h_g(const PNil &goal, ExecContext *c) const { return false; }
201+ virtual bool repay_h_g(const PString &goal, ExecContext *c) const { return false; }
202+ virtual bool repay_h_g(const PDouble &goal, ExecContext *c) const { return false; }
203+ virtual bool repay_h_g(const PInteger &goal, ExecContext *c) const { return false; }
204+ virtual bool repay_h_g(const PList &goal, ExecContext *c) const { return false; }
205+ virtual bool repay_h_g(const PArray &goal, ExecContext *c) const { return false; }
206+ virtual bool repay_h_g(const PPredicate &goal, ExecContext *c) const { return false; }
207+ virtual bool repay_h_g(const PVeriable &goal, ExecContext *c) const { return false; }
208+ virtual bool repay_h_g(const PEVeriable &goal, ExecContext *c) const { return false; }
209+ virtual bool repay_h_g(const PWildCard &goal, ExecContext *c) const { return true; }
210+ virtual bool repay_g_h(const PNil &horn, ExecContext *c) const { return false; }
211+ virtual bool repay_g_h(const PString &horn, ExecContext *c) const { return false; }
212+ virtual bool repay_g_h(const PDouble &horn, ExecContext *c) const { return false; }
213+ virtual bool repay_g_h(const PInteger &horn, ExecContext *c) const { return false; }
214+ virtual bool repay_g_h(const PList &horn, ExecContext *c) const { return false; }
215+ virtual bool repay_g_h(const PArray &horn, ExecContext *c) const { return false; }
216+ virtual bool repay_g_h(const PPredicate &horn, ExecContext *c) const { return false; }
217+ virtual bool repay_g_h(const PVeriable &horn, ExecContext *c) const { return false; }
218+ virtual bool repay_g_h(const PEVeriable &horn, ExecContext *c) const { return false; }
219+ virtual bool repay_g_h(const PWildCard &horn, ExecContext *c) const { return true; }
220+
198221 // 値の取得(unify時に使用、必要なら代入用の変更PEVariableを作成する)
199222 virtual const PObject *getval( ExecContextRoot *) const { return this; }
200223 virtual const PObject *getval2( ExecContextRoot *, VLocal *) const { return this; }
@@ -327,7 +350,7 @@
327350 virtual bool unify(const PVeriable &horn, ExecContextRoot *c) const;
328351 virtual bool unify(const PEVeriable &horn, ExecContextRoot *c) const;
329352
330- //ホーン節検索時のマッチング
353+ // ホーン節検索時のマッチング
331354 virtual bool match_h_g(const PObject &goal, ExecContext *c) const;
332355 virtual bool match_h_g(const PNil &goal, ExecContext *c) const;
333356 virtual bool match_h_g(const PList &goal, ExecContext *c) const;
@@ -338,6 +361,17 @@
338361 virtual bool match_g_h(const PVeriable &horn, ExecContext *c) const;
339362 virtual bool match_g_h(const PEVeriable &horn, ExecContext *c) const;
340363
364+ // execute後の戻り値の設定
365+ virtual bool repay_h_g(const PObject &goal, ExecContext *c) const;
366+ virtual bool repay_h_g(const PNil &goal, ExecContext *c) const;
367+ virtual bool repay_h_g(const PList &goal, ExecContext *c) const;
368+ virtual bool repay_h_g(const PVeriable &goal, ExecContext *c) const;
369+ virtual bool repay_h_g(const PEVeriable &goal, ExecContext *c) const;
370+ virtual bool repay_g_h(const PNil &horn, ExecContext *c) const;
371+ virtual bool repay_g_h(const PList &horn, ExecContext *c) const;
372+ virtual bool repay_g_h(const PVeriable &horn, ExecContext *c) const;
373+ virtual bool repay_g_h(const PEVeriable &horn, ExecContext *c) const;
374+
341375 // 変換して値を取得
342376 virtual bool cnv_string(string &value) const { return true; };
343377
@@ -440,6 +474,15 @@
440474 virtual bool match_g_h(const PVeriable &horn, ExecContext *c) const;
441475 virtual bool match_g_h(const PEVeriable &horn, ExecContext *c) const;
442476
477+ // execute後の戻り値の設定
478+ virtual bool repay_h_g(const PObject &goal, ExecContext *c) const;
479+ virtual bool repay_h_g(const PString &goal, ExecContext *c) const;
480+ virtual bool repay_h_g(const PVeriable &goal, ExecContext *c) const;
481+ virtual bool repay_h_g(const PEVeriable &goal, ExecContext *c) const;
482+ virtual bool repay_g_h(const PString &horn, ExecContext *c) const;
483+ virtual bool repay_g_h(const PVeriable &horn, ExecContext *c) const;
484+ virtual bool repay_g_h(const PEVeriable &horn, ExecContext *c) const;
485+
443486 // 値の取得
444487 virtual const char *c_str() const { return value.c_str(); };
445488
@@ -563,7 +606,18 @@
563606 virtual bool match_g_h(const PInteger &horn, ExecContext *c) const;
564607 virtual bool match_g_h(const PVeriable &horn, ExecContext *c) const;
565608 virtual bool match_g_h(const PEVeriable &horn, ExecContext *c) const;
566-
609+
610+ // execute後の戻り値の設定
611+ virtual bool repay_h_g(const PObject &goal, ExecContext *c) const;
612+ virtual bool repay_h_g(const PDouble &goal, ExecContext *c) const;
613+ virtual bool repay_h_g(const PInteger &goal, ExecContext *c) const;
614+ virtual bool repay_h_g(const PVeriable &goal, ExecContext *c) const;
615+ virtual bool repay_h_g(const PEVeriable &goal, ExecContext *c) const;
616+ virtual bool repay_g_h(const PDouble &horn, ExecContext *c) const;
617+ virtual bool repay_g_h(const PInteger &horn, ExecContext *c) const;
618+ virtual bool repay_g_h(const PVeriable &horn, ExecContext *c) const;
619+ virtual bool repay_g_h(const PEVeriable &horn, ExecContext *c) const;
620+
567621 //値の取得
568622 virtual const double *c_double() const { return &value; };
569623
@@ -695,6 +749,16 @@
695749 virtual bool match_g_h(const PVeriable &horn, ExecContext *c) const;
696750 virtual bool match_g_h(const PEVeriable &horn, ExecContext *c) const;
697751
752+ // execute後の戻り値の設定
753+ virtual bool repay_h_g(const PObject &goal, ExecContext *c) const;
754+ virtual bool repay_h_g(const PDouble &goal, ExecContext *c) const;
755+ virtual bool repay_h_g(const PInteger &goal, ExecContext *c) const;
756+ virtual bool repay_h_g(const PVeriable &goal, ExecContext *c) const;
757+ virtual bool repay_h_g(const PEVeriable &goal, ExecContext *c) const;
758+ virtual bool repay_g_h(const PDouble &horn, ExecContext *c) const;
759+ virtual bool repay_g_h(const PInteger &horn, ExecContext *c) const;
760+ virtual bool repay_g_h(const PVeriable &horn, ExecContext *c) const;
761+ virtual bool repay_g_h(const PEVeriable &horn, ExecContext *c) const;
698762
699763 // 値の取得
700764 mutable PINTEGER32 value32;
@@ -911,6 +975,17 @@
911975 virtual bool match_g_h(const PVeriable &horn, ExecContext *c) const;
912976 virtual bool match_g_h(const PEVeriable &horn, ExecContext *c) const;
913977
978+ // execute後の戻り値の設定
979+ virtual bool repay_h_g(const PObject &goal, ExecContext *c) const;
980+ virtual bool repay_h_g(const PNil &goal, ExecContext *c) const;
981+ virtual bool repay_h_g(const PList &goal, ExecContext *c) const;
982+ virtual bool repay_h_g(const PVeriable &goal, ExecContext *c) const;
983+ virtual bool repay_h_g(const PEVeriable &goal, ExecContext *c) const;
984+ virtual bool repay_g_h(const PNil &horn, ExecContext *c) const;
985+ virtual bool repay_g_h(const PList &horn, ExecContext *c) const;
986+ virtual bool repay_g_h(const PVeriable &horn, ExecContext *c) const;
987+ virtual bool repay_g_h(const PEVeriable &horn, ExecContext *c) const;
988+
914989 // 値の取得
915990 virtual const PObject *getval( ExecContextRoot *) const;
916991 virtual const PObject *getval2( ExecContextRoot *c, VLocal *vlocal) const;
@@ -1234,7 +1309,18 @@
12341309 virtual bool match_g_h(const PVeriable &horn, ExecContext *c) const;
12351310 virtual bool match_g_h(const PEVeriable &horn, ExecContext *c) const;
12361311
1312+ // execute後の戻り値の設定
1313+ virtual bool repay_h_g(const PObject &goal, ExecContext *c) const;
1314+ virtual bool repay_h_g(const PNil &goal, ExecContext *c) const;
1315+ virtual bool repay_h_g(const PArray &goal, ExecContext *c) const;
1316+ virtual bool repay_h_g(const PVeriable &goal, ExecContext *c) const;
1317+ virtual bool repay_h_g(const PEVeriable &goal, ExecContext *c) const;
1318+ virtual bool repay_g_h(const PNil &horn, ExecContext *c) const;
1319+ virtual bool repay_g_h(const PArray &horn, ExecContext *c) const;
1320+ virtual bool repay_g_h(const PVeriable &horn, ExecContext *c) const;
1321+ virtual bool repay_g_h(const PEVeriable &horn, ExecContext *c) const;
12371322
1323+
12381324 // 値の取得
12391325 virtual const PObject *getval( ExecContextRoot *c) const;
12401326 virtual const PObject *getval2( ExecContextRoot *c, VLocal *vlocal) const;
@@ -1487,6 +1573,15 @@
14871573 virtual bool match_g_h(const PVeriable &horn, ExecContext *c) const;
14881574 virtual bool match_g_h(const PEVeriable &horn, ExecContext *c) const;
14891575
1576+ // execute後の戻り値の設定
1577+ virtual bool repay_h_g(const PObject &goal, ExecContext *c) const;
1578+ virtual bool repay_h_g(const PPredicate &goal, ExecContext *c) const;
1579+ virtual bool repay_h_g(const PVeriable &goal, ExecContext *c) const;
1580+ virtual bool repay_h_g(const PEVeriable &goal, ExecContext *c) const;
1581+ virtual bool repay_g_h(const PPredicate &horn, ExecContext *c) const;
1582+ virtual bool repay_g_h(const PVeriable &horn, ExecContext *c) const;
1583+ virtual bool repay_g_h(const PEVeriable &horn, ExecContext *c) const;
1584+
14901585 // 値の取得
14911586 virtual const PObject *getval( ExecContextRoot *c) const;
14921587 virtual const PObject *getval2( ExecContextRoot *c, VLocal *vlocal) const;
@@ -1612,6 +1707,27 @@
16121707 virtual bool match_g_h(const PVeriable &horn, ExecContext *c) const;
16131708 virtual bool match_g_h(const PEVeriable &horn, ExecContext *c) const;
16141709
1710+ // execute後の戻り値の設定
1711+ virtual bool repay_h_g(const PObject &goal, ExecContext *c) const;
1712+ virtual bool repay_h_g(const PNil &goal, ExecContext *c) const;
1713+ virtual bool repay_h_g(const PString &goal, ExecContext *c) const;
1714+ virtual bool repay_h_g(const PDouble &goal, ExecContext *c) const;
1715+ virtual bool repay_h_g(const PInteger &goal, ExecContext *c) const;
1716+ virtual bool repay_h_g(const PList &goal, ExecContext *c) const;
1717+ virtual bool repay_h_g(const PArray &goal, ExecContext *c) const;
1718+ virtual bool repay_h_g(const PPredicate &goal, ExecContext *c) const;
1719+ virtual bool repay_h_g(const PVeriable &goal, ExecContext *c) const;
1720+ virtual bool repay_h_g(const PEVeriable &goal, ExecContext *c) const;
1721+ virtual bool repay_g_h(const PNil &horn, ExecContext *c) const;
1722+ virtual bool repay_g_h(const PString &horn, ExecContext *c) const;
1723+ virtual bool repay_g_h(const PDouble &horn, ExecContext *c) const;
1724+ virtual bool repay_g_h(const PInteger &horn, ExecContext *c) const;
1725+ virtual bool repay_g_h(const PList &horn, ExecContext *c) const;
1726+ virtual bool repay_g_h(const PArray &horn, ExecContext *c) const;
1727+ virtual bool repay_g_h(const PPredicate &horn, ExecContext *c) const;
1728+ virtual bool repay_g_h(const PVeriable &horn, ExecContext *c) const;
1729+ virtual bool repay_g_h(const PEVeriable &horn, ExecContext *c) const;
1730+
16151731 // 値の取得
16161732 virtual const PObject *getval( ExecContextRoot *c) const ;
16171733 virtual const PObject *getval2( ExecContextRoot *c, VLocal *vlocal) const ;
@@ -1730,9 +1846,29 @@
17301846 virtual bool match_g_h(const PWildCard &horn, ExecContext *c) const { return true; }
17311847 virtual bool match_g_h(const PEVeriable &horn, ExecContext *c) const{ return true; }
17321848
1733- // 値の取得
1734- // 代入
1735-
1849+ // execute後の戻り値の設定
1850+ virtual bool repay_h_g(const PObject &goal, ExecContext *c) const { return true; }
1851+ virtual bool repay_h_g(const PNil &goal, ExecContext *c) const { return true; }
1852+ virtual bool repay_h_g(const PString &goal, ExecContext *c) const { return true; }
1853+ virtual bool repay_h_g(const PDouble &goal, ExecContext *c) const { return true; }
1854+ virtual bool repay_h_g(const PInteger &goal, ExecContext *c) const { return true; }
1855+ virtual bool repay_h_g(const PList &goal, ExecContext *c) const { return true; }
1856+ virtual bool repay_h_g(const PArray &goal, ExecContext *c) const { return true; }
1857+ virtual bool repay_h_g(const PPredicate &goal, ExecContext *c) const { return true; }
1858+ virtual bool repay_h_g(const PVeriable &goal, ExecContext *c) const { return true; }
1859+ virtual bool repay_h_g(const PWildCard &goal, ExecContext *c) const { return true; }
1860+ virtual bool repay_h_g(const PEVeriable &goal, ExecContext *c) const{ return true; }
1861+ virtual bool repay_g_h(const PNil &horn, ExecContext *c) const { return true; }
1862+ virtual bool repay_g_h(const PString &horn, ExecContext *c) const { return true; }
1863+ virtual bool repay_g_h(const PDouble &horn, ExecContext *c) const { return true; }
1864+ virtual bool repay_g_h(const PInteger &horn, ExecContext *c) const { return true; }
1865+ virtual bool repay_g_h(const PList &horn, ExecContext *c) const { return true; }
1866+ virtual bool repay_g_h(const PArray &horn, ExecContext *c) const { return true; }
1867+ virtual bool repay_g_h(const PPredicate &horn, ExecContext *c) const { return true; }
1868+ virtual bool repay_g_h(const PVeriable &horn, ExecContext *c) const { return true; }
1869+ virtual bool repay_g_h(const PWildCard &horn, ExecContext *c) const { return true; }
1870+ virtual bool repay_g_h(const PEVeriable &horn, ExecContext *c) const{ return true; }
1871+
17361872 // メモリマネージャによるdelete
17371873 virtual void del();
17381874 virtual void deltree(PObjectArray *objs); // objsに関係しているメモリを削除(持っているオブジェクトも合わせて削除する)
@@ -1831,6 +1967,27 @@
18311967 virtual bool match_g_h(const PVeriable &horn, ExecContext *c) const;
18321968 virtual bool match_g_h(const PEVeriable &horn, ExecContext *c) const;
18331969
1970+ // execute後の戻り値の設定
1971+ virtual bool repay_h_g(const PObject &goal, ExecContext *c) const;
1972+ virtual bool repay_h_g(const PNil &goal, ExecContext *c) const;
1973+ virtual bool repay_h_g(const PString &goal, ExecContext *c) const;
1974+ virtual bool repay_h_g(const PDouble &goal, ExecContext *c) const;
1975+ virtual bool repay_h_g(const PInteger &goal, ExecContext *c) const;
1976+ virtual bool repay_h_g(const PList &goal, ExecContext *c) const;
1977+ virtual bool repay_h_g(const PArray &goal, ExecContext *c) const;
1978+ virtual bool repay_h_g(const PPredicate &goal, ExecContext *c) const;
1979+ virtual bool repay_h_g(const PVeriable &goal, ExecContext *c) const;
1980+ virtual bool repay_h_g(const PEVeriable &goal, ExecContext *c) const;
1981+ virtual bool repay_g_h(const PNil &horn, ExecContext *c) const;
1982+ virtual bool repay_g_h(const PString &horn, ExecContext *c) const;
1983+ virtual bool repay_g_h(const PDouble &horn, ExecContext *c) const;
1984+ virtual bool repay_g_h(const PInteger &horn, ExecContext *c) const;
1985+ virtual bool repay_g_h(const PList &horn, ExecContext *c) const;
1986+ virtual bool repay_g_h(const PArray &horn, ExecContext *c) const;
1987+ virtual bool repay_g_h(const PPredicate &horn, ExecContext *c) const;
1988+ virtual bool repay_g_h(const PVeriable &horn, ExecContext *c) const;
1989+ virtual bool repay_g_h(const PEVeriable &horn, ExecContext *c) const;
1990+
18341991 // 値の取得
18351992 virtual const PObject *getval( ExecContextRoot *c) const;
18361993 virtual const PObject *getval2( ExecContextRoot *c, VLocal *) const;
--- trunk/adp.cpp (revision 307)
+++ trunk/adp.cpp (revision 308)
@@ -23,12 +23,12 @@
2323
2424 // 定数
2525 #ifdef ___X64____
26-#define VERSION_TEXT "ADP Ver 0.82.0307 X64 (http://www.adp.la/)\nCopyright (C) 2010-2012 Katsuhisa Ohfuji. This progman is distributed under GPL.\n"
26+#define VERSION_TEXT "ADP Ver 0.82.0308 X64 (http://www.adp.la/)\nCopyright (C) 2010-2012 Katsuhisa Ohfuji. This progman is distributed under GPL.\n"
2727 #else
2828 #if _WIN32
29-#define VERSION_TEXT "ADP Ver 0.82.0307 x86 (http://www.adp.la/)\nCopyright (C) 2010-2012 Katsuhisa Ohfuji. This progman is distributed under GPL.\n"
29+#define VERSION_TEXT "ADP Ver 0.82.0308 x86 (http://www.adp.la/)\nCopyright (C) 2010-2012 Katsuhisa Ohfuji. This progman is distributed under GPL.\n"
3030 #else
31-#define VERSION_TEXT "ADP Ver 0.82.0307 (http://www.adp.la/)\nCopyright (C) 2010-2012 Katsuhisa Ohfuji. This progman is distributed under GPL.\n"
31+#define VERSION_TEXT "ADP Ver 0.82.0308 (http://www.adp.la/)\nCopyright (C) 2010-2012 Katsuhisa Ohfuji. This progman is distributed under GPL.\n"
3232 #endif
3333 #endif
3434
--- trunk/adp_execute.cpp (revision 307)
+++ trunk/adp_execute.cpp (revision 308)
@@ -645,21 +645,19 @@
645645 // 実行後の代入処理
646646 for ( ArrayNoexpand<size_t>::iterator i = afterunify.begin(); i < afterunify.end(); i++ ) {
647647 if ( hsiz == gsiz || ((*i) < hsiz - 1 && (*i) < gsiz - 1) ) {
648- flg = horn->head.arglist.value[*i]->unify( *pred->arglist.value[*i], this, hl, gl);
648+ flg = horn->head.arglist.value[*i]->repay_h_g( *pred->arglist.value[*i], this);
649649 } else if ( gsiz < hsiz ) {
650- flg = ao->unify( *pred->arglist.value[*i], this, hl, gl);
650+ flg = ao->repay_h_g( *pred->arglist.value[*i], this);
651651 } else {
652- flg = horn->head.arglist.value[*i]->unify( *ao, this, hl, gl);
652+ flg = horn->head.arglist.value[*i]->repay_h_g( *ao, this);
653653 }
654- if ( !flg ) {
655- break;
656- }
654+ if ( !flg ) break;
657655 }
658656 if ( flg ) {
659657 if ( goal->nobacktrack == true ) {
660658 // ↓変数の受け渡しをclone/deleteで行っているが、objs間の移動の方が効率はよくないか?(検索が入るのでこちらの方が早い?)
661659 // バグフィックス
662-#if 1
660+#if 0
663661 for ( ArrayNoexpand<size_t>::iterator i = afterunify.begin(); i < afterunify.end(); i++ ) {
664662 const PVeriable *v = dynamic_cast<const PVeriable*>((*pred)[*i]);
665663 if ( v ) {
@@ -727,11 +725,11 @@
727725 // 実行後の代入処理
728726 for ( ArrayNoexpand<size_t>::iterator i = afterunify.begin(); i < afterunify.end(); i++ ) {
729727 if ( hsiz == gsiz || ((*i) < hsiz - 1 && (*i) < gsiz - 1) ) {
730- flg = horn->head.arglist.value[*i]->unify( *pred->arglist.value[*i], this, hl, gl);
728+ flg = horn->head.arglist.value[*i]->repay_h_g( *pred->arglist.value[*i], this);
731729 } else if ( gsiz < hsiz ) {
732- flg = ao->unify( *pred->arglist.value[*i], this, hl, gl);
730+ flg = ao->repay_h_g( *pred->arglist.value[*i], this);
733731 } else {
734- flg = horn->head.arglist.value[*i]->unify( *ao, this, hl, gl);
732+ flg = horn->head.arglist.value[*i]->repay_h_g( *ao, this);
735733 }
736734 if ( !flg ) break;
737735 }
@@ -739,7 +737,7 @@
739737 if ( goal->nobacktrack == true ) {
740738 // ↓変数の受け渡しをclone/deleteで行っているが、objs間の移動の方が効率はよくないか?(検索が入るのでこちらの方が早い?)
741739 // バグフィックス
742-#if 1
740+#if 0
743741 for ( ArrayNoexpand<size_t>::iterator i = afterunify.begin(); i < afterunify.end(); i++ ) {
744742 const PVeriable *v = dynamic_cast<const PVeriable*>((*pred)[*i]);
745743 if ( v ) {
Show on old repository browser