Commit 15353732 authored by Custom2043's avatar Custom2043

gne.

parent 478fd2e1
......@@ -2,5 +2,5 @@ package inflow;
public interface Operation {
public HigherInfo apply(HigherInfo onInfo, OperationList on, HigherInfo refInfos);
public AndInfo knowing(HigherInfo resultInfo, OperationList resultList, OperationList callerList, HigherInfo refInfos);
public AndInfo knowing(HigherInfo resultInfo, OperationList resultList, OperationList callerList, SpaceInfos refInfos);
}
......@@ -76,31 +76,28 @@ public class OperationList
return ((ConstantValue)this.baseValue).value;
}
public HigherInfo knowing(boolean value, HigherInfo refInfos)
public SpaceInfos knowing(boolean value, SpaceInfos refInfos)
{
return this.knowing(new ValueInfo(new BooleanValueInfo(value)), refInfos);
}
public SpaceInfos knowing(HigherInfo resultInfo, HigherInfo refInfos)
public SpaceInfos knowing(HigherInfo resultInfo, SpaceInfos refInfos)
{
SpaceInfos totalDeduced = new SpaceInfos();
HigherInfo toAdd = NoInfo.instance;
for(int i=this.operationList.size() - 1; ;i--)
{
if (i == -1)
{
if (this.baseValue instanceof VariableValue)
totalDeduced.addInfo((VariableValue)this.baseValue, new AndInfo(toAdd, resultInfo));
return new AndInfo(toAdd, resultInfo).setValue(this.baseValue).normalize();
return NoInfo.instance;
totalDeduced.addInfo((VariableValue)this.baseValue, resultInfo);
}
Operation op = this.operationList.get(i);
AndInfo tempInfo = op.knowing(resultInfo, this.copy(i + 1), this.copy(i), refInfos);
resultInfo = tempInfo.info1.normalize();
toAdd = new AndInfo(toAdd, tempInfo.info2).normalize();
resultInfo = resultInfo.getInfosOn(i == 0 ? this.baseValue : this.selfValues[i - 1]).normalize();
if (op instanceof MethodUse && ((MethodUse)op).args.length == 1)
totalDeduced.merge(((MethodUse)op).args[0].knowing(tempInfo.info2.normalize(), refInfos));
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment