File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ let iter_exp_opt_funcs = ["Option.map"; "option_zipWith"; "option_map3"]
99let error at msg = Util.Error. error at " Lean4 translation" msg
1010
1111(* List of declaration ids that are hand-coded in the preamble *)
12- let builtins = [ " disjoint_" ]
12+ let builtins = [ " disjoint_" ; " setminus1_ " ; " setminus_ " ]
1313
1414let rec list_split (f : 'a -> bool ) = function
1515 | [] -> ([] , [] )
@@ -744,6 +744,10 @@ macro "opaqueDef" : term => `(by first | exact Inhabited.default | intros; assum
744744def disjoint_ (X : Type ) [BEq X] : ∀ (var_0 : (List X) ), Bool
745745 | [] => true
746746 | (w :: w'_lst ) => ((!(List. contains w'_lst w )) && (disjoint_ X w'_lst ))
747+
748+ /- written manually due to `BEq` constraint -/
749+ def setminus_ (X : Type ) [BEq X] (l1 l2 : List X ) : List X :=
750+ l1 .filter (fun x => !(List. contains l2 x ))
747751|}
748752
749753
You can’t perform that action at this time.
0 commit comments