phil_algs / t2ab /algdict2.txt
luciangreen's picture
Upload 1424 files
557a17a verified
[["(",""],["and","a,b"],["cut","!"],["delete","delete(A,B,C)"],["divide","A is B/C"],["enter object name (without spaces), if different for noodle","|: write"],["enter object name (without spaces), if different for turtle","|: write"],["enter object name (without spaces), if different for tuxedo","|: write"],["enter object name (without spaces), if different for yacht",""],["equals","A=B"],["foldr(append)","foldr(append,A,B)"],["foldr(string_concat)","foldr(string_concat,A,B)"],["greater_than","A>B"],["halt","halt"],["intersection","intersection2(A,B,C):-intersection2(A,B,[],C),!. intersection2([],_,A,A):-!. intersection2([A1|A2],B,C,D):- member1(A1,B), intersection2(A2,B,[A1|C],D). intersection2([_|A2],B,C,D):- intersection2(A2,B,C,D). member1(A,[A|_]):-!. member1(A,[_|B2]):-member1(A,B2)."],["left_bracket","A=[B]"],["less_than","A<B"],["ls","ls"],["minus","A is B-1"],["multiply","A is B*C"],["not_equals","not(A=B)"],["or","a;b"],["plus","A is B+C"],["query","a(A,B)"],["string_concat","string_concat(A,B,C)"],["subtract","subtract1(C,[],C):-!. subtract1(A,[B1|B2],E):-delete1(A,B1,[],D),subtract1(D,B2,E). delete1([],_,C,C):-!. delete1([A1|A2],A1,C,D):-delete1(A2,A1,C,D),!. delete1([A1|A2],B,C,D):-delete1(A2,B,[A1|C],D),!."],["wheelbarrow","A is B+C"],["write","writeln(A)"]]