2 changed files with 62 additions and 11 deletions
@ -0,0 +1,23 @@
|
||||
package formulae |
||||
|
||||
/* ---------------------------------------------------------------- * |
||||
* METHOD Get Atoms |
||||
* ---------------------------------------------------------------- */ |
||||
|
||||
func schemeGetAtoms(fml Formula, prevValues [](*[]Formula)) *[]Formula { |
||||
if fml.IsAtom() { |
||||
return &[]Formula{fml.Copy()} |
||||
} else { |
||||
var results = []Formula{} |
||||
for _, prevValue := range prevValues { |
||||
results = append(results, *prevValue...) |
||||
} |
||||
return &results |
||||
} |
||||
} |
||||
|
||||
var fnGetAtoms = CreateFromSchemeFmlsValued(schemeGetAtoms) |
||||
|
||||
func (fml Formula) GetAtoms() []Formula { |
||||
return *fnGetAtoms(fml) |
||||
} |
Loading…
Reference in new issue