Permalink
Browse files

10

  • Loading branch information...
1 parent 4b950df commit 72b0088210921d4cb4c330d9539968a9f1c1f35c @akkartik committed Dec 14, 2008
Showing with 50 additions and 48 deletions.
  1. +2 −0 CodeLog
  2. +3 −3 common.pl
  3. +19 −19 h/h0.pl
  4. +1 −1 h/h114.pl
  5. +4 −4 h/h114a.pl
  6. +7 −7 h/h174.pl
  7. +1 −1 h/h204.pl
  8. +1 −1 h/h36
  9. +3 −3 h/h402.pl
  10. +2 −2 h/h407.pl
  11. +3 −3 h/h408.pl
  12. +1 −1 h/h409.pl
  13. +2 −2 h/h92.pl
  14. +1 −1 h/old-h174.pl
View
2 CodeLog
@@ -43,3 +43,5 @@ Ok, now I can start it up with just:
[am].
am.
=-=9 - Thu Dec 11 12:30:41 PST 2008
+assert->assertz in heuristics.
+=-=10 - Sun Dec 14 11:19:34 PST 2008
View
6 common.pl
@@ -198,9 +198,9 @@
%to put a single element onto a slot
% the first clause catches all changes to the concept base and displays them.
-put(C,S,V):-
- watch_mode_on, % if you want a trace,
- print_put_trace(C,S,V). % ! This will fail and backtrack to the real put/3.
+%? put(C,S,V):-
+%? watch_mode_on, % if you want a trace,
+%? print_put_trace(C,S,V). % ! This will fail and backtrack to the real put/3.
put(C,S,V) :- put1(C,S,V),!.
/* This stuff is duplicated in am.pl so it will be interpreted because it
View
38 h/h0.pl
@@ -14,15 +14,15 @@
N > 5, N < 30,
(retract(frame(C,[worth],[Worth]));Worth = 100),
Worth2 is Worth + (Worth + 1)/5,
- assert(frame(C,[worth],[Worth2])).
+ assertz(frame(C,[worth],[Worth2])).
h402(C):-
(exs(C,Examples);get(C,[examples,typ],Examples)),
length(Examples,N),
N < 5,
(retract(frame(C,[worth],[Worth]));Worth = 1),
Worth2 is Worth/2,
- assert(frame(C,[worth],[Worth2])).
+ assertz(frame(C,[worth],[Worth2])).
@@ -32,7 +32,7 @@
N > 40,
(retract(frame(C,[worth],[Worth])); Worth = 1),
Worth2 is Worth/2,
- assert(frame(C,[worth],[Worth2])).
+ assertz(frame(C,[worth],[Worth2])).
@@ -44,13 +44,13 @@
h407(F):-
get(F,[worth],[Worth]),
Worth > 200,
- assert(flag),
+ assertz(flag),
getarity(F,N1), N is N1 -1,
loop_composit(F,F,N,[],Glist,[],FoGdr,1),
makename(F,'_o_',Temp),
loopmakename(Temp,Glist,SeedName),
loop_make_composit(F,SeedName,Glist,FoGdr,Newname,Algorogo,N,0),!,
- assert(flag),
+ assertz(flag),
create_composite_concept2(F,Glist,Newname,Algorogo,FoGdr).
loop_composit(F,G,N,X,X,Y,Y,_):-
@@ -94,7 +94,7 @@
put(Conceptname,[name],Conceptname),
put(Conceptname,[defn,name],Conceptname),
put(Conceptname,[alg],Conceptname),
- assert(frame(Conceptname,[dom_range],Dom_range)),
+ assertz(frame(Conceptname,[dom_range],Dom_range)),
put(Conceptname,[genl],F),
get(F,[worth],[W1]),
put(Conceptname,[worth],W1),
@@ -122,9 +122,9 @@
C0 = (Pred2:- CP1,Count1 > Count, retract(CP2)),
C1 = (Pred4:- Pred1, (retract(CP1);
Count1 = 0), Count2 is Count1 + 1,
- assert(CP2),
+ assertz(CP2),
Pred3),
- assert(C1),
+ assertz(C1),
asserta(C0),nl, write(C0),nl, write(C1),nl,Alg=[C0,C1].
@@ -209,7 +209,7 @@
reverse(List,Rlist),
Pred3 =.. [Nname|Rlist],
Alg2 = (Pred3:-Pred2,not(Range = D2)),
- assert(Alg2));true),
+ assertz(Alg2));true),
asserta(Alg),nl,write(Alg),nl,write(Alg2),nl.
@@ -223,7 +223,7 @@
check_with_user(Concept,Relation,NewConcept,NewClauses,NewConceptName,NewClauses2):- not(if_Flag),
matchtoname(NewClauses,Cname),
- assert(gensymed_concepts(Concept,NewConcept,Relation,Cname)),
+ assertz(gensymed_concepts(Concept,NewConcept,Relation,Cname)),
NewClauses2 = NewClauses, NewConcept = NewConceptname.
matchtoname([[C|T]],C).
@@ -246,7 +246,7 @@
!.
-run_I_face:- assert(if_Flag),
+run_I_face:- assertz(if_Flag),
gensymed_concepts(Concept,NewConcept,Relation,OldName),
check_with_user(Concept,Relation,NewConcept,NewClauses,NewConceptname,
NewClauses2),
@@ -269,24 +269,24 @@
split(A,[[L,C,L2,W1,L3]|Tail]),
W2 is W1 + W,
inc_tasks(C,Tail,W,[[L,Nc,L2,W2,L4]|O],P),
- assert(agenda(P)).
+ assertz(agenda(P)).
/*check_with_user(Concept,Relation,NewConcept,NewClauses,NewConceptName,NewClauses2):-
- assert(gensymed_concepts(Concept,NewClauses,Relation)),
+ assertz(gensymed_concepts(Concept,NewClauses,Relation)),
NewClauses2 = NewClauses.
*/
/*If C1 is a genl of C2 if C2 is a fenl of C3 ... if Ck is a genl of Cn then
merge and increase the value of the highest value to begin with*/
-h114(C):- assert(counter(0)),h114_it(C,C,0,[]).
+h114(C):- assertz(counter(0)),h114_it(C,C,0,[]).
h114a(C):-h114_ita(C,C,0,[]).
h114_it(Present_C,C,Counter,CTrail):-
Counter < 100,
retract(counter(_)),
- assert(counter(Counter)),
+ assertz(counter(Counter)),
get(Present_C,[genl],Value),!,
notmember(C,Value),!,
first_element_defn(Value,FirstElement),
@@ -302,7 +302,7 @@
h114_ita(Present_C,C,Counter,CTrail):-
Counter < 100,
retract(counter(_)),
- assert(counter(Counter)),
+ assertz(counter(Counter)),
get(Present_C,[spec],Value),!,
notmember(C,Value),!,
first_element_defn(Value,FirstElement),
@@ -319,7 +319,7 @@
merge_cons(C,Ctrail),
retract(C,[worth],[Worth2]),
Worth3 is Worth2 + Worth2/2,
- assert(C,[worth],[Worth3]).
+ assertz(C,[worth],[Worth3]).
merge_cons(C,[]).
@@ -331,7 +331,7 @@
merge_cons(C,[C2|Ctrail]):-
get(C2,X,Y),
not(get(C,X,Y)),
- assert(frame(C,X,Y)),
+ assertz(frame(C,X,Y)),
retract(frame(C2,X,Y)),
merge_cons(C,Ctrail).
@@ -360,7 +360,7 @@
Defn2,
retract(C,[examples,typ],V2),
append(V2,F,V3),
- assert(C,[examples,typ],V3).
+ assertz(C,[examples,typ],V3).
frame(gob1,[genl],[gob2,gob3]).
View
2 h/h114.pl
@@ -5,6 +5,6 @@
*/
-h114(C):- assert(counter(0)),h114_it(C,C,0,[]).
+h114(C):- assertz(counter(0)),h114_it(C,C,0,[]).
View
8 h/h114a.pl
@@ -3,7 +3,7 @@
h114_it(Present_C,C,Counter,CTrail):-
Counter < 100,
retract(counter(_)),
- assert(counter(Counter)),
+ assertz(counter(Counter)),
get(Present_C,[genl],Value),!,
notmember(C,Value),!,
first_element_defn(Value,FirstElement),
@@ -19,7 +19,7 @@
h114_ita(Present_C,C,Counter,CTrail):-
Counter < 100,
retract(counter(_)),
- assert(counter(Counter)),
+ assertz(counter(Counter)),
get(Present_C,[spec],Value),!,
notmember(C,Value),!,
first_element_defn(Value,FirstElement),
@@ -36,7 +36,7 @@
merge_cons(C,Ctrail),
retract(C,[worth],[Worth2]),
Worth3 is Worth2 + Worth2/2,
- assert(C,[worth],[Worth3]).
+ assertz(C,[worth],[Worth3]).
merge_cons(C,[]).
@@ -48,7 +48,7 @@
merge_cons(C,[C2|Ctrail]):-
get(C2,X,Y),
not(get(C,X,Y)),
- assert(frame(C,X,Y)),
+ assertz(frame(C,X,Y)),
retract(frame(C2,X,Y)),
merge_cons(C,Ctrail).
View
14 h/h174.pl
@@ -58,13 +58,13 @@
h174(F,G):-
- assert(flag),
+ assertz(flag),
getarity(F,N1), N is N1 -1,
loop_composit(F,G,N,[],Glist,[],FoGdr,1),
makename(F,'_o_',Temp),
loopmakename(Temp,Glist,SeedName),
loop_make_composit(F,SeedName,Glist,FoGdr,Newname,Algorogo,N,0),!,
- assert(flag),
+ assertz(flag),
create_composite_concept2(F,Glist,Newname,Algorogo,FoGdr).
@@ -82,7 +82,7 @@
Pred2 =.. [Topname|List],
Alg = (Pred2:-Pred1),
write(Alg),
- assert(Alg).
+ assertz(Alg).
loop_make_composit(F,Topname,[G|Glist],[FoGdr|FoGdrlist],Newname2,Alg2,Arity,Q):-
length(FoGdr,N),
@@ -109,11 +109,11 @@
write(Alg),
(/*flag,*/fail,
check_with_user2(F,G,Topname,Alg,Newname2),
- assert(newname(Newname2));
+ assertz(newname(Newname2));
Newname2 = Topname),
Func4=..[Newname2|Newdr],
Alg2=(Func4:-Func1,Func2),
- assert(Alg2),
+ assertz(Alg2),
(retract(flag); true),
Arity2 is Arity - 1,
Q2 is Q + 1,
@@ -196,7 +196,7 @@
check_with_user2(F,G,Newname,Alg,Newname2),
Func4=..[Newname2|Newdr],
Alg2=(Func4:-Func1,Func2),
- assert(Alg2).
+ assertz(Alg2).
/* create_composite_concept creates a concept frame for the new operation.
Then a task is added to the agenda to generate examples of the new
@@ -260,7 +260,7 @@
*/
/* taking this unnecessary gabbing out! -marcos*/
check_with_user2(F,G,Newname,Alg,Newname2):-
- assert(gensymed_concepts(Newname,Alg,none)).
+ assertz(gensymed_concepts(Newname,Alg,none)).
check_with_user2(F,G,Newname,Alg,Newname2):-
nl,nl,
write('I have created a new concept definition which is a composition of '),nl,
View
2 h/h204.pl
@@ -26,7 +26,7 @@
h204assert(Name,Alg) :-
Body =.. [Alg,X,X],
Head =.. [Name,X],
- assert((Head :- Body)).
+ assertz((Head :- Body)).
h204_worth(N,C) :- get(C,[coalesce],[]),
get(C,[worth],W),
View
2 h/h36
@@ -11,5 +11,5 @@ h36_limited(C,Counter):-
Defn2,
retract(C,[examples,typ],V2),
append(V2,F,V3),
- assert(C,[examples,typ],V3).
+ assertz(C,[examples,typ],V3).
View
6 h/h402.pl
@@ -14,15 +14,15 @@
N > 5, N < 30,
(retract(frame(C,[worth],[Worth]));Worth = 100),
Worth2 is Worth + (Worth + 1)/5,
- assert(frame(C,[worth],[Worth2])).
+ assertz(frame(C,[worth],[Worth2])).
h402(C):-
(exs(C,Examples);get(C,[examples,typ],Examples)),
length(Examples,N),
N < 5,
(retract(frame(C,[worth],[Worth]));Worth = 1),
Worth2 is Worth/2,
- assert(frame(C,[worth],[Worth2])).
+ assertz(frame(C,[worth],[Worth2])).
@@ -32,7 +32,7 @@
N > 40,
(retract(frame(C,[worth],[Worth])); Worth = 1),
Worth2 is Worth/2,
- assert(frame(C,[worth],[Worth2])).
+ assertz(frame(C,[worth],[Worth2])).
bget(_,_,_):-write('bogus definition of bget'),nl,
View
4 h/h407.pl
@@ -8,13 +8,13 @@
h407(F):-
get(F,[worth],[Worth]),
Worth > 200,
- assert(flag),
+ assertz(flag),
getarity(F,N1), N is N1 -1,
loop_composit2(F,F,N,[],Glist,[],FoGdr,1),
makename(F,'_o_',Temp),
loopmakename(Temp,Glist,SeedName),
loop_make_composit(F,SeedName,Glist,FoGdr,Newname,Algorogo,N,0),!,
- assert(flag),
+ assertz(flag),
create_composite_concept2(F,Glist,Newname,Algorogo,FoGdr).
loop_composit2(F,G,N,X,X,Y,Y,_):-
View
6 h/h408.pl
@@ -28,7 +28,7 @@
put(Conceptname,[name],Conceptname),
put(Conceptname,[defn,name],Conceptname),
put(Conceptname,[alg],Conceptname),
- assert(frame(Conceptname,[dom_range],Dom_range)),
+ assertz(frame(Conceptname,[dom_range],Dom_range)),
put(Conceptname,[genl],F),
get(F,[worth],[W1]),
put(Conceptname,[worth],W1),
@@ -56,9 +56,9 @@
C0 = (Pred2:- CP1,Count1 > Count, retract(CP2)),
C1 = (Pred4:- Pred1, (retract(CP1);
Count1 = 0), Count2 is Count1 + 1,
- assert(CP2),
+ assertz(CP2),
Pred3),
- assert(C1),
+ assertz(C1),
asserta(C0),nl, write(C0),nl, write(C1),nl,Alg=[C0,C1].
View
2 h/h409.pl
@@ -46,7 +46,7 @@
reverse(List,Rlist),
Pred3 =.. [Nname|Rlist],
Alg2 = (Pred3:-Pred2,not(Range = D2)),
- assert(Alg2));true),
+ assertz(Alg2));true),
asserta(Alg),nl,write(Alg),nl,write(Alg2),nl.
View
4 h/h92.pl
@@ -90,7 +90,7 @@
***/
check_with_user(Concept,_,X,Y,X,Y):-
- assert(gensymed_concepts(Concept)), !.
+ assertz(gensymed_concepts(Concept)), !.
check_with_user(Concept,Relation,NewConcept,NewClauses,NewConceptName,NewClauses2):-
nl,nl,
write(' I have created a concept definition which is a '), write(Relation),
@@ -168,7 +168,7 @@
conditionof2(Cond,(X,Y)):- conditionof2(Cond,Y).
/*** assertset does the inverse of collectclauses: given a list of
-**** clauses, assert each clause to the database. Note that assertz
+**** clauses, assertz each clause to the database. Note that assertz
**** is used to maintain order of the clauses.
***/
View
2 h/old-h174.pl
@@ -62,7 +62,7 @@
check_with_user2(F,G,Newname,Alg,Newname2),
Func4=..[Newname2|Newdr],
Alg2=(Func4:-Func1,Func2),
- assert(Alg2).
+ assertz(Alg2).
/* create_composite_concept creates a concept frame for the new operation.
Then a task is added to the agenda to generate examples of the new

0 comments on commit 72b0088

Please sign in to comment.