Sets of Variables #
This file implements set of variables with the aim to be both easy to work with and effient at runtime.
Sets of variables #
@[instance_reducible]
@[instance_reducible]
Equations
@[reducible]
Equations
- STRIPS.VarSet.instHasSubset = { Subset := fun (V V' : STRIPS.VarSet n) => ∀ (i : Fin n), i ∈ V → i ∈ V' }
@[instance_reducible]
Equations
- STRIPS.VarSet.instEmptyCollection = { emptyCollection := { toBitVec := BitVec.zero n } }
Return the VarSet containing all variables in V and the variable i.
Equations
- STRIPS.VarSet.insert i V = { toBitVec := V.toBitVec ||| BitVec.twoPow n ↑i }
Instances For
Return the VarSet containing all variables in V except the variable i.
Equations
- STRIPS.VarSet.erase i V = { toBitVec := V.toBitVec &&& ~~~BitVec.twoPow n ↑i }
Instances For
Return the VarSet containing all variables.
Equations
- STRIPS.VarSet.all = { toBitVec := BitVec.allOnes n }
Instances For
Return the VarSet containing all variables i for which f i is true.
Equations
- STRIPS.VarSet.ofFn f = { toBitVec := BitVec.ofFnLE f }
Instances For
@[instance_reducible]
Equations
- STRIPS.VarSet.instUnion = { union := fun (V V' : STRIPS.VarSet n) => { toBitVec := V.toBitVec ||| V'.toBitVec } }
@[instance_reducible]
Equations
- STRIPS.VarSet.instInter = { inter := fun (V V' : STRIPS.VarSet n) => { toBitVec := V.toBitVec &&& V'.toBitVec } }
@[instance_reducible]
Equations
- STRIPS.VarSet.instCompl = { compl := fun (V : STRIPS.VarSet n) => { toBitVec := ~~~V.toBitVec } }
Folds a function over all variables in V with starting value init. The variables are combined
in increasing order.
Equations
Instances For
theorem
STRIPS.VarSet.foldl_induction
{α : Sort u_1}
{n : ℕ}
{V : VarSet n}
(motive : ℕ → α → Prop)
{f : α → Fin n → α}
{init : α}
(hinit : motive 0 init)
(hmem : ∀ (a : α) (i : Fin n), i ∈ V → motive (↑i) a → motive (↑i + 1) (f a i))
(hnmem : ∀ (a : α) (i : Fin n), ¬i ∈ V → motive (↑i) a → motive (↑i + 1) a)
:
motive n (foldl f init V)
Return the VarSet containing the variables f i for every variable i in V.
Equations
- V.map f = STRIPS.VarSet.foldl (fun (V' : STRIPS.VarSet m) (i : Fin n) => STRIPS.VarSet.insert (f i) V') ∅ V
Instances For
The list containing all variables in the given VarSet, in no particular order.
Equations
Instances For
@[instance_reducible]
Equations
- One or more equations did not get rendered due to their size.
@[instance_reducible]
Equations
- STRIPS.VarSet.instToString = { toString := fun (V : STRIPS.VarSet n) => (Std.format V).pretty }