View Source Ash.SatSolver (ash v3.4.48)
Tools for working with the satsolver that drives filter subset checking (for authorization)
This is public as a very low level toolkit for writing authorizers, but you almost certainly do not need to look at this module.
If you are looking for information about how authorization works, see the policy guide
Summary
Functions
Creates tuples of a boolean statement.
Returns b(not (left and right))
Returns b(not (left and not right))
Returns a statement expressing that the predicates are mutually exclusive.
Returns a statement expressing that the predicates are mutually exclusive and collectively exhaustive.
Returns a statement expressing that the predicates are mutually inclusive
Returns b(not (right and left))
Returns b(not (right and not left))
Returns true if the candidate filter returns the same or less data than the filter
Returns true
if the relationship paths are synonymous from a data perspective
Transforms a statement to Conjunctive Normal Form(CNF), as lists of lists of integers.
Prepares a filter for comparison
Calls transform/2
and solves the expression
Functions
Creates tuples of a boolean statement.
i.e b(1 and 2) #=> {:and, 1, 2}
@spec left_excludes_right(Ash.Expr.t(), Ash.Expr.t()) :: boolean_expr()
Returns b(not (left and right))
Returns b(not (left and not right))
Returns a statement expressing that the predicates are mutually exclusive.
@spec mutually_exclusive_and_collectively_exhaustive([Ash.Expr.t()]) :: boolean_expr()
Returns a statement expressing that the predicates are mutually exclusive and collectively exhaustive.
Returns a statement expressing that the predicates are mutually inclusive
@spec right_excludes_left(Ash.Expr.t(), Ash.Expr.t()) :: boolean_expr()
Returns b(not (right and left))
@spec right_implies_left(Ash.Expr.t(), Ash.Expr.t()) :: boolean_expr()
Returns b(not (right and not left))
@spec strict_filter_subset(Ash.Filter.t(), Ash.Filter.t()) :: boolean() | :maybe
Returns true if the candidate filter returns the same or less data than the filter
@spec synonymous_relationship_paths?( Ash.Resource.t(), [atom()], [atom()], Ash.Resource.t() ) :: boolean()
Returns true
if the relationship paths are synonymous from a data perspective
Transforms a statement to Conjunctive Normal Form(CNF), as lists of lists of integers.
@spec transform(Ash.Resource.t(), Ash.Expr.t()) :: boolean_expr()
Prepares a filter for comparison
@spec transform_and_solve(Ash.Resource.t(), Ash.Expr.t()) :: {:ok, [integer()]} | {:error, :unsatisfiable}
Calls transform/2
and solves the expression