Skip to content

Commit 6196192

Browse files
committed
Added Clause interfaces to interface.otter
1 parent d3c6d87 commit 6196192

File tree

4 files changed

+71
-0
lines changed

4 files changed

+71
-0
lines changed

aima-csharp/aima-csharp.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,9 @@
115115
<Compile Include="logic\fol\domain\FOLDomainListener.cs" />
116116
<Compile Include="logic\fol\domain\FOLDomainSkolemConstantAddedEvent.cs" />
117117
<Compile Include="logic\fol\domain\FOLDomainSkolemFunctionAddedEvent.cs" />
118+
<Compile Include="logic\fol\inference\ClauseFilter.cs" />
119+
<Compile Include="logic\fol\inference\ClauseSimplifier.cs" />
120+
<Compile Include="logic\fol\inference\LightestClauseHeuristic.cs" />
118121
<Compile Include="logic\fol\kb\data\Chain.cs" />
119122
<Compile Include="logic\fol\kb\data\Clause.cs" />
120123
<Compile Include="logic\fol\kb\data\CNF.cs" />
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using aima.core.logic.fol.kb.data;
4+
5+
namespace aima.core.logic.fol.inference.otter
6+
{
7+
/**
8+
* @author Ciaran O'Reilly
9+
*
10+
*/
11+
public interface ClauseFilter
12+
{
13+
HashSet<Clause> filter(HashSet<Clause> clauses);
14+
}
15+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using aima.core.logic.fol.kb.data;
4+
5+
namespace aima.core.logic.fol.inference.otter
6+
{
7+
/**
8+
* @author Ciaran O'Reilly
9+
*
10+
*/
11+
public interface ClauseSimplifier
12+
{
13+
Clause simplify(Clause c);
14+
}
15+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using aima.core.logic.fol.kb.data;
4+
5+
namespace aima.core.logic.fol.inference.otter
6+
{
7+
/**
8+
* Heuristic for selecting lightest clause from SOS. To avoid recalculating the
9+
* lightest clause on every call, the interface supports defining the initial
10+
* sos and updates to that set so that it can maintain its own internal data
11+
* structures to allow for incremental re-calculation of the lightest clause.
12+
*
13+
* @author Ciaran O'Reilly
14+
*
15+
*/
16+
public interface LightestClauseHeuristic
17+
{
18+
/**
19+
* Get the lightest clause from the SOS
20+
*
21+
* @return the lightest clause.
22+
*/
23+
Clause getLightestClause();
24+
25+
/**
26+
* SOS life-cycle methods allowing implementations of this interface to
27+
* incrementally update the calculation of the lightest clause as opposed to
28+
* having to recalculate each time.
29+
*
30+
* @param clauses
31+
*/
32+
void initialSOS(HashSet<Clause> clauses);
33+
34+
void addedClauseToSOS(Clause clause);
35+
36+
void removedClauseFromSOS(Clause clause);
37+
}
38+
}

0 commit comments

Comments
 (0)