Permalink
Browse files

FR-3305959: Added support for 'none' action Implication.

  • Loading branch information...
ddossot
ddossot committed May 31, 2011
1 parent 4edb15c commit 74d2422255ce495f838c0dff5493d00f04a3a6c5
Binary file not shown.
View
@@ -1,5 +1,11 @@
-NxBRE README v3.2.0
-===================
+
+ _______ _______________________________
+ \ \ ___ __\______ \______ \_ _____/
+ / | \\ \/ /| | _/| _/| __)_
+/ | \> < | | \| | \| \
+\____|__ /__/\_ \|______ /|____|_ /_______ /
+ \/ \/ \/ \/ \/
+
URL : http://nxbre.org
EMail : contact@nxbre.org
@@ -8,6 +14,13 @@ License : LGPL
## RELEASE NOTES ##
+v3.3.0
+
+ Inference Engine
+
+ * Added support for 'none' action Implication (feature request 3305959).
+
+
v3.2.0
General
@@ -160,6 +160,14 @@ flag{?object, triggeredZ}
balance{?account, actualValue, 25}
-> isTwentyFive{?account};
+[label:No Action Implication;action:none;]
+noopTrigger{foo}
+-> doNotAssert{bar};
+
+[label:No Action Implication Checker;precondition:No Action Implication;]
+noopTrigger{foo}
+-> noopPreconditioned{OK};
+
[label:Retracting Implication;action:retract;]
retractionTrigger{?target}
-> toRetract{?target};
@@ -962,6 +962,48 @@
</atom>
</_body>
</imp>
+ <imp>
+ <_rlab>
+ <ind>label:No Action Implication;action:none;</ind>
+ </_rlab>
+ <_head>
+ <atom>
+ <_opr>
+ <rel>doNotAssert</rel>
+ </_opr>
+ <ind>bar</ind>
+ </atom>
+ </_head>
+ <_body>
+ <atom>
+ <_opr>
+ <rel>noopTrigger</rel>
+ </_opr>
+ <ind>foo</ind>
+ </atom>
+ </_body>
+ </imp>
+ <imp>
+ <_rlab>
+ <ind>label:No Action Implication Checker;precondition:No Action Implication;</ind>
+ </_rlab>
+ <_head>
+ <atom>
+ <_opr>
+ <rel>noopPreconditioned</rel>
+ </_opr>
+ <ind>OK</ind>
+ </atom>
+ </_head>
+ <_body>
+ <atom>
+ <_opr>
+ <rel>noopTrigger</rel>
+ </_opr>
+ <ind>foo</ind>
+ </atom>
+ </_body>
+ </imp>
<imp>
<_rlab>
<ind>label:Retracting Implication;action:retract;</ind>
@@ -1261,7 +1303,7 @@
</imp>
<imp>
<_rlab>
- <ind>Atom Combination Bug 1346078</ind>
+ <ind>atom Combination Bug 1346078</ind>
</_rlab>
<_head>
<atom>
@@ -952,6 +952,48 @@
</Atom>
</head>
</Implies>
+ <Implies>
+ <oid>
+ <Ind>label:No Action Implication;action:none;</Ind>
+ </oid>
+ <body>
+ <Atom>
+ <op>
+ <Rel>noopTrigger</Rel>
+ </op>
+ <Ind>foo</Ind>
+ </Atom>
+ </body>
+ <head>
+ <Atom>
+ <op>
+ <Rel>doNotAssert</Rel>
+ </op>
+ <Ind>bar</Ind>
+ </Atom>
+ </head>
+ </Implies>
+ <Implies>
+ <oid>
+ <Ind>label:No Action Implication Checker;precondition:No Action Implication;</Ind>
+ </oid>
+ <body>
+ <Atom>
+ <op>
+ <Rel>noopTrigger</Rel>
+ </op>
+ <Ind>foo</Ind>
+ </Atom>
+ </body>
+ <head>
+ <Atom>
+ <op>
+ <Rel>noopPreconditioned</Rel>
+ </op>
+ <Ind>OK</Ind>
+ </Atom>
+ </head>
+ </Implies>
<Implies>
<oid>
<Ind>label:Retracting Implication;action:retract;</Ind>
@@ -954,6 +954,48 @@
</Atom>
</head>
</Implies>
+ <Implies>
+ <oid>
+ <Ind>label:No Action Implication;action:none;</Ind>
+ </oid>
+ <body>
+ <Atom>
+ <op>
+ <Rel>noopTrigger</Rel>
+ </op>
+ <Ind>foo</Ind>
+ </Atom>
+ </body>
+ <head>
+ <Atom>
+ <op>
+ <Rel>doNotAssert</Rel>
+ </op>
+ <Ind>bar</Ind>
+ </Atom>
+ </head>
+ </Implies>
+ <Implies>
+ <oid>
+ <Ind>label:No Action Implication Checker;precondition:No Action Implication;</Ind>
+ </oid>
+ <body>
+ <Atom>
+ <op>
+ <Rel>noopTrigger</Rel>
+ </op>
+ <Ind>foo</Ind>
+ </Atom>
+ </body>
+ <head>
+ <Atom>
+ <op>
+ <Rel>noopPreconditioned</Rel>
+ </op>
+ <Ind>OK</Ind>
+ </Atom>
+ </head>
+ </Implies>
<Implies>
<oid>
<Ind>label:Retracting Implication;action:retract;</Ind>
@@ -7,9 +7,9 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("AgilePartner S.A.")]
[assembly: AssemblyProduct("NxBRE")]
-[assembly: AssemblyCopyright("Copyright (C) 2003-2009 David Dossot et al.")]
+[assembly: AssemblyCopyright("Copyright (C) 2003-2011 David Dossot et al.")]
[assembly: AssemblyTrademark("NxBRE is distributed under the GNU LESSER GENERAL PUBLIC LICENSE.")]
[assembly: AssemblyCulture("")]
-[assembly: AssemblyVersion("3.2.0.*")]
+[assembly: AssemblyVersion("3.3.0.*")]
[assembly: CLSCompliant(true)]
[assembly: InternalsVisibleTo("NxBRE-UnitTest")]
@@ -766,9 +766,8 @@ public sealed class IEImpl:IInferenceEngine {
public IList<IList<Fact>> RunQuery(Query query) {
CheckInitialized();
if (query == null) {
- throw new BREException("Query is null or not found.");
+ throw new BREException("Query is null!");
}
-
return WM.FB.RunQuery(query);
}
@@ -788,7 +787,11 @@ public sealed class IEImpl:IInferenceEngine {
/// <param name="queryLabel">The label of the Query to run.</param>
/// <returns>An <code>IList&lt;IList&lt;Fact>></code> containing the results found.</returns>
public IList<IList<Fact>> RunQuery(string queryLabel) {
- return RunQuery(QB.Get(queryLabel));
+ Query query = QB.Get(queryLabel);
+ if (query == null) {
+ throw new BREException("No query found for label: " + queryLabel);
+ }
+ return RunQuery(query);
}
/// <summary>
@@ -1113,6 +1116,11 @@ public sealed class IEImpl:IInferenceEngine {
}
}
}
+ else if (implication.Action == ImplicationAction.None)
+ {
+ if (Logger.IsInferenceEngineVerbose) Logger.InferenceEngineSource.TraceEvent(TraceEventType.Verbose, 0, "No Action Implication '" + implication.Label + "' matched: " + processResults.Count);
+ implicationResultsCount = processResults.Count;
+ }
else {
throw new BREException("Implication action not supported: " + implication.Action);
}
@@ -413,6 +413,9 @@ protected struct RelationResolution {
case "modify":
action = ImplicationAction.Modify;
break;
+ case "none":
+ action = ImplicationAction.None;
+ break;
default:
throw new BREException("An Implication can not perform the action: " + ip.action);
}
@@ -8,7 +8,7 @@ namespace NxBRE.InferenceEngine.Rules {
/// <summary>
/// The possibile implication actions.
/// </summary>
- public enum ImplicationAction {Assert, Retract, Count, Modify};
+ public enum ImplicationAction {Assert, Retract, Count, Modify, None};
/// <summary>
/// The remarkable implication priorities. Any value between in the [0-100] is valid.
View
@@ -0,0 +1,18 @@
+
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual Studio 2005
+# SharpDevelop 2.2.1.2648
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NxBRE", "NxBRE.csproj", "{C5A2507E-550E-4EEC-B3C2-A278ECB27E30}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {C5A2507E-550E-4EEC-B3C2-A278ECB27E30}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {C5A2507E-550E-4EEC-B3C2-A278ECB27E30}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {C5A2507E-550E-4EEC-B3C2-A278ECB27E30}.Release|Any CPU.Build.0 = Release|Any CPU
+ {C5A2507E-550E-4EEC-B3C2-A278ECB27E30}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ EndGlobalSection
+EndGlobal
@@ -6,8 +6,8 @@
[assembly: AssemblyDescription("Unit tests for NxBRE")]
[assembly: AssemblyCompany("AgilePartner S.A.")]
[assembly: AssemblyProduct("NxBRE")]
-[assembly: AssemblyCopyright("Copyright (C) 2003-2008 David Dossot et al.")]
+[assembly: AssemblyCopyright("Copyright (C) 2003-2011 David Dossot et al.")]
[assembly: AssemblyTrademark("NxBRE is distributed under the GNU LESSER GENERAL PUBLIC LICENSE.")]
[assembly: AssemblyCulture("")]
-[assembly: AssemblyVersion("3.2.0.*")]
+[assembly: AssemblyVersion("3.3.0.*")]
[assembly: CLSCompliant(true)]
Oops, something went wrong.

0 comments on commit 74d2422

Please sign in to comment.