我在prolog中有以下文件, 1111000011110000.pl :
:- multifile firstname/1.
:- multifile surname/1.
:- multifile cardNumber/1.
:- multifile code/1.
:- multifile balance/1.
% firstname("Martin").
firstname([77, 97, 114, 116, 105, 110]).
% surname("Andersson").
surname([65, 110, 100, 101, 114, 115, 115, 111, 110]).
% cardNumber(card-number)
cardNumber(1111000011110000).
% code(code)
code(1337).
% balance(balance)
balance(3230000).
我想创建一个带整数输入(例如0)的谓词并修改1111000011110000.pl文件,以便将balance-predicate的参数更改为0.例如,在使用谓词之后我就是应该将1111000011110000.pl文件修改为:
:- multifile firstname/1.
:- multifile surname/1.
:- multifile cardNumber/1.
:- multifile code/1.
:- multifile balance/1.
% firstname("Martin").
firstname([77, 97, 114, 116, 105, 110]).
% surname("Andersson").
surname([65, 110, 100, 101, 114, 115, 115, 111, 110]).
% cardNumber(card-number)
cardNumber(1111000011110000).
% code(code)
code(1337).
% balance(balance)
balance(0).
这是可能的prolog? :)