public CreateInstruction ( string instructionName ) : |
||
instructionName | string | |
return |
public AbstractInstruction CreateInstruction(string instructionName)
{
return CreateInstruction(instructionName, "", "", "", "");
}
AMInstructionSet::CreateInstruction ( string instructionName, string arg1 ) : |
|
AMInstructionSet::CreateInstruction ( string instructionName, string arg1, string arg2 ) : |
|
AMInstructionSet::CreateInstruction ( string instructionName, string arg1, string arg2, string arg3 ) : |
|
AMInstructionSet::CreateInstruction ( string instructionName, string arg1, string arg2, string arg3, string arg4 ) : |
public void Call() { ArrayList prog = new ArrayList(); prog.Add(new NopInstruction()); prog.Add(new HaltInstruction()); AbstractMachineState state = new AbstractMachineState(new AMFactory()); state.Initialize(prog); AMProgram program = (AMProgram)state.Program; ArrayList predicateCode = new ArrayList(); AMInstructionSet iset = new AMInstructionSet(); // say_hello(X) :- write(X). predicateCode.Add(iset.CreateInstruction("bcall", "write/1")); predicateCode.Add(iset.CreateInstruction("proceed")); AbstractTerm X0 = (AbstractTerm)state["X0"]; X0.Assign(new ConstantTerm("Hello, World!")); program.AssertFirst("say_hello", 1, predicateCode); Assert.IsTrue(state.Call("say_hello", 1, new object[] { "Hello man" })); }