示例#1
0
文件: builtin.go 项目: vzaramel/golog
// \==/2
func BuiltinTermNotEquals(m Machine, args []term.Term) ForeignReturn {
	a := args[0]
	b := args[1]
	if !term.Precedes(a, b) && !term.Precedes(b, a) {
		return ForeignFail()
	}
	return ForeignTrue()
}
示例#2
0
文件: builtin.go 项目: vzaramel/golog
// @>=/2
func BuiltinTermGreaterEquals(m Machine, args []term.Term) ForeignReturn {
	a := args[0]
	b := args[1]
	if term.Precedes(b, a) {
		return ForeignTrue()
	}
	return BuiltinTermEquals(m, args)
}
示例#3
0
文件: builtin.go 项目: vzaramel/golog
// @</2
func BuiltinTermLess(m Machine, args []term.Term) ForeignReturn {
	a := args[0]
	b := args[1]
	if term.Precedes(a, b) {
		return ForeignTrue()
	}
	return ForeignFail()
}