"""Create logic_validator
Generated by Phi-Octopus Eden
2025-11-07 04:46:56.255108
"""

```python
def create_logic_validator(logic_str: str) -> callable:
    """
    Creates a validator function from a logical expression string.

    Args:
        logic_str (str): A string representing a logical expression.
                         Variables in the expression should be names of input parameters.

    Returns:
        callable: A function that takes variable number of arguments based on logic_str and
                  returns True if the logical expression is satisfied, False otherwise.

    Example Usage:
        validator = create_logic_validator("x > 10 and y < 5")
        result = validator(x=20, y=4)  # Returns True
        result = validator(x=8, y=6)   # Returns False

    Note:
        - The logical expression should use Python's built-in comparison operators: >, >=, <, <=, ==, !=.
        - Variable names in the string must match the argument names when calling the returned function.
    """
    import ast
    import collections

    class ExpressionTreeBuilder(ast.NodeVisitor):
        def visit_BinOp(self, node: ast.BinOp) -> ast.Expression:
            left = self.visit(node.left)
            right = self.visit(node.right)

            if isinstance(node.op, (ast.And, ast.Or)):
                return ast.BoolOp(node.op.__class__(), [left, right])
            else:
                return ast.BinOp(left, node.op, right)

        def visit_UnaryOp(self, node: ast.UnaryOp) -> ast.Expression:
            operand = self.visit(node.operand)
            if isinstance(node.op, (ast.Not)):
                return ast.UnaryOp(node.op, operand)
            else:
                raise ValueError(f"Unsupported Unary Op {node.op}")

        def visit_Name(self, node: ast.Name) -> ast.Name:
            return ast.Name(id=node.id, ctx=ast.Load())

        def visit_Compare(self, node: ast.Compare) -> ast.Expression:
            left = self.visit(node.left)
            ops = [self.visit(op) for op in node.ops]
            comparators = [self.visit(comparator) for comparator in node.comparators]

            return ast.BoolOp(ast.And(), [
                ast.Compare(left, [op], comparators[:1])
                for op, comparators in zip(ops, collections.deque(comparators).itertuples())
            ])

        def generic_visit(self, node: ast.AST) -> None:
            raise ValueError(f"Unsupported Node {type(node)}")

    class ExpressionEvaluator(ast.NodeVisitor):
        def __init__(self, locals_vars: dict = {}):
            self.locals_vars = locals_vars

        def visit_BoolOp(self, node: ast.BoolOp) -> bool:
            values = [self.visit(value) for value in node.values]
            if isinstance(node.op, (ast.And)):
                return all(values)
            elif isinstance(node.op, (ast.Or)):
                return any(values)

        def visit_UnaryOp(self, node: ast.UnaryOp) -> bool:
            operand_value = self.visit(node.operand)
            return not operand_value

        def visit_BinOp(self, node: ast.BinOp) -> bool:
            left_value = self.visit(node.left)
            right_value = self.visit(node.right)

            if isinstance(node.op, (ast.Gt)):
                return left_value > right_value
            elif isinstance(node.op, (ast.Lt)):
                return left_value < right_value
            elif isinstance(node.op, (ast.GtE)):
                return left_value >= right_value
            elif isinstance(node.op, (ast.LtE)):
                return left_value <= right_value
            elif isinstance(node.op, (ast.Eq)):
                return left_value == right_value
            elif isinstance(node.op, (ast.NotEq)):
                return left_value != right_value

        def visit_Name(self, node: ast.Name) -> bool:
            return self.locals_vars[node.id]

    tree = ast.parse(logic_str, mode='eval')
    builder = ExpressionTreeBuilder()
    expression = builder.visit(tree.body)
    evaluator = ExpressionEvaluator()

    def logic_validator(**kwargs):
        for k, v in kwargs.items():
            if k not in locals().keys():
                raise ValueError(f"Invalid parameter name {k}")
            else:
                locals()[k] = v
        return evaluator.visit(expression)

    return logic_validator


# Example usage
validator = create_logic_validator("x > 10 and y < 5")
result = validator(x=20, y=4)  # True
print(result)
result = validator(x=8, y=6)   # False
print(result)
```