Newer
Older
using System.Collections.Generic;
using System.Linq.Expressions;
using System;
using System.Linq;
MaZiFAU
committed
public static class SOMDocManager
MaZiFAU
committed
public static class MMT_OMS_URI
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
public static readonly string Point = "http://mathhub.info/MitM/core/geometry?3DGeometry?point";
public static readonly string Tuple = "http://gl.mathhub.info/MMT/LFX/Sigma?Symbols?Tuple";
public static readonly string LineType = "http://mathhub.info/MitM/core/geometry?Geometry/Common?line_type";
public static readonly string LineOf = "http://mathhub.info/MitM/core/geometry?Geometry/Common?lineOf";
public static readonly string OnLine = "http://mathhub.info/MitM/core/geometry?Geometry/Common?onLine";
public static readonly string Ded = "http://mathhub.info/MitM/Foundation?Logic?ded";
public static readonly string Eq = "http://mathhub.info/MitM/Foundation?Logic?eq";
public static readonly string Metric = "http://mathhub.info/MitM/core/geometry?Geometry/Common?metric";
public static readonly string Angle = "http://mathhub.info/MitM/core/geometry?Geometry/Common?angle_between";
public static readonly string Sketch = "http://mathhub.info/MitM/Foundation?InformalProofs?proofsketch";
public static readonly string RealLit = "http://mathhub.info/MitM/Foundation?RealLiterals?real_lit";
public static readonly string ParallelLine = "http://mathhub.info/MitM/core/geometry?Geometry/Common?parallelLine";
//public static readonly string RectangleFact = "http://mathhub.info/FrameIT/frameworld?FrameITRectangles?rectangleType";
//public static readonly string RectangleFactmk = "http://mathhub.info/FrameIT/frameworld?FrameITRectangles?mkRectangle";
public static readonly string CircleType3d = "http://mathhub.info/FrameIT/frameworld?FrameITCircle?circleType3D";
public static readonly string MkCircle3d = "http://mathhub.info/FrameIT/frameworld?FrameITCircle?circle3D";
public static readonly string TriangleMiddlePoint = "http://mathhub.info/FrameIT/frameworld?FrameITTriangles?triangleMidPointWrapper";
public static readonly string RadiusCircleMetric = "http://mathhub.info/FrameIT/frameworld?FrameITCircle?circleRadius";
public static readonly string AreaCircle = "http://mathhub.info/FrameIT/frameworld?FrameITCircle?areaCircle";
public static readonly string VolumeCone = "http://mathhub.info/FrameIT/frameworld?FrameITCone?volumeCone";
public static readonly string ConeOfCircleApex = "http://mathhub.info/FrameIT/frameworld?FrameITCone?circleConeOf";
public static readonly string ParametrizedPlane = "http://mathhub.info/MitM/core/geometry?Planes?ParametrizedPlane";
public static readonly string pointNormalPlane = "http://mathhub.info/MitM/core/geometry?Planes?pointNormalPlane";
public static readonly string OnCircle = "http://mathhub.info/FrameIT/frameworld?FrameITCircle?pointOnCircle";
public static readonly string AnglePlaneLine = "http://mathhub.info/FrameIT/frameworld?FrameITCircle?angleCircleLine";
public static readonly string OrthoCircleLine = "http://mathhub.info/FrameIT/frameworld?FrameITCircle?orthogonalCircleLine";
public static readonly string TruncatedVolumeCone = "http://mathhub.info/FrameIT/frameworld?FrameITCone?truncatedConeVolume";
public static readonly string CylinderVolume = "http://mathhub.info/FrameIT/frameworld?FrameITCylinder?cylinderVolume";
public static readonly string EqualityCircles = "http://mathhub.info/FrameIT/frameworld?FrameITCircle?equalityCircles";
public static readonly string UnEqualityCircles = "http://mathhub.info/FrameIT/frameworld?FrameITCircle?unequalityCircles";
public static readonly string ParallelCircles = "http://mathhub.info/FrameIT/frameworld?FrameITCone?parallelCircles";
public static readonly string RightAngle = "http://mathhub.info/FrameIT/frameworld?FrameITBasics?rightAngle";
public static readonly string TestType = "http://mathhub.info/FrameIT/frameworld?FrameITCircle?xcircleType3D";
public static readonly string Sin = "Sin";
public static readonly string Cos = "Cos";
public static readonly string Add = "Add";
public static readonly string Divide = "Divide";
public static readonly string Multiply = "Multiply";
public static readonly string Subtract = "Subtract";
public static readonly string SquareRoot = "SquareRoot";
//public static readonly string MakeUnityEngineVector3 = "UnityEngine.Vector3";
public static readonly string MakeObjectArray = "MakeObjectArray";
MaZiFAU
committed
public static class SOMDoctoLambdaExpression<T>
{
// TODO: Populate Dictionaries
#region ExpressionDictionaries
delegate LambdaExpression CustomFunction(LambdaExpression[] args_lamda, ParameterExpression[] bound_params);
MaZiFAU
committed
private static readonly Dictionary<string, CustomFunction> MMTtoLambdaMaker = new()
{ MMT_OMS_URI.Sin,
{ MMT_OMS_URI.Cos,
{ MMT_OMS_URI.SquareRoot,
MaZiFAU
committed
MakeUnityEngineVector3},
private static readonly Dictionary<string, ExpressionType> MMTtoBinaryExpressionType = new()
{ MMT_OMS_URI.Add,
{ "AddAssign",
{ "AddAssignChecked",
{ "AddChecked",
{ "And",
{ "AndAlso",
{ "AndAssign",
{ "Assign",
{ MMT_OMS_URI.Divide,
{ "DivideAssign",
{ "Equal",
{ "ExclusiveOr",
{ "ExclusiveOrAssign",
{ "GreaterThan",
{ "GreaterThanOrEqual",
{ "LeftShift",
{ "LeftShiftAssign",
{ "LessThan",
{ "LessThanOrEqual",
{ "Modulo",
{ "ModuloAssign",
{ MMT_OMS_URI.Multiply,
{ "MultiplyAssign",
{ "MultiplyAssignChecked",
ExpressionType.MultiplyAssignChecked},
{ "MultiplyChecked",
{ "NotEqual",
{ "Or",
{ "OrAssign",
{ "OrElse",
{ "Power",
{ "PowerAssign",
{ "RightShift",
{ "RightShiftAssign",
{ MMT_OMS_URI.Subtract,
{ "SubtractAssign",
{ "SubtractAssignChecked",
ExpressionType.SubtractAssignChecked},
{ "SubtractChecked",
ExpressionType.SubtractChecked},
};
private static readonly Dictionary<string, ExpressionType> MMTtoUnaryExpressionType = new()
{
//{ "Constant", // Not Unary
// ExpressionType.Constant},
{ "Convert",
{ "ConvertChecked",
{ "Decrement",
{ "Increment",
{ "Negate",
{ "NegateChecked",
{ "Not",
{ "OnesComplement",
{ "PostDecrementAssign",
{ "PostIncrementAssign",
{ "PreDecrementAssign",
{ "PreIncrementAssign",
{ "UnaryPlus",
ExpressionType.UnaryPlus},
};
#endregion ExpressionDictionaries
//TODO: case ((f->x)->y) instead of assumed (f->(x->y))
public static LambdaExpression MakeLambdaExpression(string URI, LambdaExpression[] lambda_args, ParameterExpression[] bound_params)
void ThrowArgumentException(ExpressionType expression_cast, int expected)
{
throw new ArgumentException(string.Format(
"\"Wrong number of Arguments. Required: {2}. Supplied: {3}.\\n\\tFor URI:\\\"{0}\\\"\\n\\tmapped to:\\\"{1}\\\"\"",
URI, expression_cast, expected, lambda_args.Count()
ParameterExpression[] lambda_params =
lambda_args
.SelectMany(l => l.Parameters)
.ToArray(); //PERF: .ToList().Sort() => .BinarySearch;
ParameterExpression[] found_bound_params =
bound_params
.Where(p => lambda_params.Contains(p))
.ToArray();
if (MMTtoUnaryExpressionType.TryGetValue(URI, out var unnary_type))
{
ThrowArgumentException(unnary_type, 1);
Type UnarySecondArgument = found_bound_params.Count() < 2 ? null : found_bound_params[1].Type;
return Expression.Lambda(Expression.MakeUnary(unnary_type, lambda_args[0].Body, UnarySecondArgument), found_bound_params);
}
else if (MMTtoBinaryExpressionType.TryGetValue(URI, out var binary_type))
{
if (lambda_args.Count() != 2)
ThrowArgumentException(binary_type, 2);
return Expression.Lambda(Expression.MakeBinary(binary_type, lambda_args[0].Body, lambda_args[1].Body), found_bound_params);
}
else if (MMTtoLambdaMaker.TryGetValue(URI, out var lamda_maker))
{
throw new NotImplementedException("Could not map URI: \"" + URI + "\"");
}
private static LambdaExpression ExpresionFuncToLambda(LambdaExpression func, string name, LambdaExpression[] args_lamda, ParameterExpression[] bound_params, uint nTargs_fallback)
=> Expression.Lambda(Expression.Invoke(func, args_lamda.Select(l => l.Body)), name, bound_params);
private static LambdaExpression ParseFuncUUToExpression<U>(Func<U, U> func)
=> (Expression<Func<U, U>>)((U x) => func(x));
private static LambdaExpression MakeSin(LambdaExpression[] lambda_args, ParameterExpression[] bound_params)
=> ExpresionFuncToLambda(
default(T) switch // TODO? cleaner switch
{
float => ParseFuncUUToExpression<float>(MathF.Sin),
double => ParseFuncUUToExpression<double>(Math.Sin),
_ => throw new NotImplementedException("Sinus for " + nameof(T) + "=" + typeof(T))
},
private static LambdaExpression MakeCos(LambdaExpression[] lambda_args, ParameterExpression[] bound_params)
=> ExpresionFuncToLambda(
default(T) switch // TODO? cleaner switch
{
float => ParseFuncUUToExpression<float>(MathF.Cos),
double => ParseFuncUUToExpression<double>(Math.Cos),
_ => throw new NotImplementedException("Cosinus for " + nameof(T) + "=" + typeof(T))
MaZiFAU
committed
private static LambdaExpression MakeUnityEngineVector3(LambdaExpression[] args_lamda, ParameterExpression[] bound_params)
MaZiFAU
committed
=> ExpresionFuncToLambda(
(Expression<Func<float, float, float, Vector3>>)((x, y, z) => new Vector3(x, y, z)),
"UnityEngineVector3", args_lamda, bound_params, 3
MaZiFAU
committed
);
private static LambdaExpression MakeArray(LambdaExpression[] args_lamda, ParameterExpression[] bound_params)
=> Expression.Lambda(
Expression.NewArrayInit(
typeof(object),
args_lamda.Select(l => Expression.Convert(l.Body, typeof(object)))
),
bound_params
);
[JsonConverter(typeof(JsonSubtypes), "kind")]
[JsonSubtypes.KnownSubType(typeof(OMA), "OMA")]
[JsonSubtypes.KnownSubType(typeof(OMBINDC), "OMBINDC")]
[JsonSubtypes.KnownSubType(typeof(OMS), "OMS")]
[JsonSubtypes.KnownSubType(typeof(OMSTR), "OMSTR")]
[JsonSubtypes.KnownSubType(typeof(OMF), "OMF")]
[JsonSubtypes.KnownSubType(typeof(OMV), "OMV")]
//[JsonSubtypes.KnownSubType(typeof(OMC<T>), "OMC<" + typeof(T) + ">")]
[JsonSubtypes.KnownSubType(typeof(OMC<Vector3>), "OMC<UnityEngine.Vector3>")]
[JsonSubtypes.KnownSubType(typeof(OMC<float>), "OMC<System.Single>")]
[JsonSubtypes.KnownSubType(typeof(OMC<double>), "OMC<System.Double>")]
MaZiFAU
committed
abstract public class SOMDoc
protected static readonly IReadOnlyDictionary<string, Type> StringToType = new Dictionary<string, Type>() {
{"R",
typeof(float)},
{typeof(float).ToString(),
typeof(float)},
{typeof(double).ToString(),
typeof(double)},
{typeof(string).ToString(),
typeof(string)},
{typeof(UnityEngine.Vector3).ToString(),
typeof(UnityEngine.Vector3)},
};
[JsonIgnore]
protected static readonly IReadOnlyDictionary<Type, string> TypeToString;
MaZiFAU
committed
Dictionary<Type, string> _TypeToString = new();
foreach (KeyValuePair<string, Type> KeyVal in StringToType)
_TypeToString.TryAdd(KeyVal.Value, KeyVal.Key);
TypeToString = _TypeToString;
protected SOMDoc() { kind = this.GetType().Name; }
public static bool Equivalent(SOMDoc sd1, SOMDoc sd2)
MaZiFAU
committed
=> sd1.Equivalent(sd2);
public abstract bool Equivalent(SOMDoc sd2);
public LambdaExpression PartialInvokeCastingLambdaExpression(out Type[] signature_args, object[] args = null)
{
LambdaExpression lambda_orig =
GetLambdaExpression(new LambdaExpression[0], new ParameterExpression[0]);
signature_args = new Type[lambda_orig.Parameters.Count + 1];
ParameterExpression object_arr = Expression.Parameter(typeof(object[]), "PARAMS_Arr");
Expression[] cast_new_to_signature = new Expression[lambda_orig.Parameters.Count];
int n_params = 0;
for (int i = 0; i < lambda_orig.Parameters.Count; i++)
{
if (args != null && args.Length < i && args[i] != null)
{
cast_new_to_signature[i] =
Expression.Constant(args[i], lambda_orig.Parameters[i].Type);
continue;
}
signature_args[n_params++] = lambda_orig.Parameters[i].Type;
cast_new_to_signature[i] =
Expression.Convert(
Expression.ArrayIndex(
object_arr,
Expression.Constant(i)
),
lambda_orig.Parameters[i].Type
);
}
signature_args[n_params] = lambda_orig.ReturnType;
signature_args = signature_args.Slice(0, n_params + 1).ToArray();
return Expression.Lambda(
typeof(Array).IsAssignableFrom(lambda_orig.ReturnType)
? Expression.Convert(
Expression.Invoke(lambda_orig, cast_new_to_signature),
typeof(object[]))
: Expression.NewArrayInit(
typeof(object),
new Expression[] { Expression.Convert(Expression.Invoke(lambda_orig, cast_new_to_signature), typeof(object)) }),
object_arr
);
}
public LambdaExpression GetLambdaExpression()
=> GetLambdaExpression(new LambdaExpression[0], new ParameterExpression[0]);
protected internal abstract LambdaExpression GetLambdaExpression(LambdaExpression[] lambda_args, ParameterExpression[] bound_params);
public abstract override string ToString();
MaZiFAU
committed
public abstract SOMDoc MapURIs(Dictionary<string, string> old_to_new);
MaZiFAU
committed
#region MakeMMT_OMS_URItoSOMDoc
public static SOMDoc MakeUnityEngineVector3(Vector3 vec)
=> new OMA(
MaZiFAU
committed
new() {
new OMF(vec.x),
new OMF(vec.y),
new OMF(vec.z),
}
);
#endregion MakeMMT_OMS_URItoSOMDoc
}
public abstract class SOMDocCRTP<T> : SOMDoc where T : SOMDocCRTP<T>
{
protected SOMDocCRTP() : base() { }
MaZiFAU
committed
/// \copydoc Fact.Equivalent(Fact)
public override bool Equivalent(SOMDoc sd2)
=> this.GetType() == sd2.GetType() && (this as T).EquivalentWrapped(sd2 as T);
protected abstract bool EquivalentWrapped(T sd2);
public override SOMDoc MapURIs(Dictionary<string, string> old_to_new)
=> MapURIsWrapped(old_to_new);
public abstract T MapURIsWrapped(Dictionary<string, string> old_to_new);
public class OMBINDC : SOMDocCRTP<OMBINDC>
{
public new string kind = "OMBINDC";
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
public string name;
public SOMDoc lambdabody;
/// <summary>@Type of this variable</summary>
[JsonIgnore]
public Type type;
/// <summary>Enables (especially <see cref="JsonConverter"/>) to read and set <see cref="type"/> by its <c>string</c> representation.</summary>
public string typeString
{
get => TypeToString[type];
set => type = StringToType[value];
}
[JsonConstructor]
public OMBINDC(string name, string typeString, SOMDoc lambdabody) : base()
{
this.name = name;
this.typeString = typeString;
this.lambdabody = lambdabody;
}
public OMBINDC(string name, Type type, SOMDoc lambdabody) : base()
{
this.name = name;
this.type = type;
this.lambdabody = lambdabody;
}
protected override bool EquivalentWrapped(OMBINDC sd2)
=> this.type == sd2.type
&& this.name.Equals(sd2.name)
&& this.lambdabody.Equivalent(sd2.lambdabody);
protected internal override LambdaExpression GetLambdaExpression(LambdaExpression[] lambda_args, ParameterExpression[] bound_params)
{
ParameterExpression[] bind_me = bound_params.ShallowCloneAppend(
new[] { Expression.Parameter(type, name) }
);
return lambdabody.GetLambdaExpression(lambda_args, bind_me);
}
public override string ToString()
=> "OMBINDC(" + name + ", " + typeString + ")->";
public override OMBINDC MapURIsWrapped(Dictionary<string, string> old_to_new)
=> new(name, type, lambdabody.MapURIs(old_to_new));
}
MaZiFAU
committed
public class OMA : SOMDocCRTP<OMA>
public new string kind = "OMA";
MaZiFAU
committed
public SOMDoc applicant;
public List<SOMDoc> arguments;
public OMA(SOMDoc applicant, List<SOMDoc> arguments) : base()
{
this.applicant = applicant;
this.arguments = arguments;
}
protected override bool EquivalentWrapped(OMA sd2)
=> Equivalent(this.applicant, sd2.applicant)
MaZiFAU
committed
&& this.arguments
.Zip(sd2.arguments, (arg1, arg2) => Equivalent(arg1, arg2))
.All(b => b);
protected internal override LambdaExpression GetLambdaExpression(LambdaExpression[] lambda_args, ParameterExpression[] bound_params)
=> applicant.GetLambdaExpression(
arguments.Select(arg => arg.GetLambdaExpression(lambda_args, bound_params)).ToArray(),
bound_params
);
public override string ToString()
=> applicant.ToString() + "(" + string.Join(", ", arguments.Select(a => a.ToString())) + ")";
public override OMA MapURIsWrapped(Dictionary<string, string> old_to_new)
=> new OMA(
applicant.MapURIs(old_to_new),
arguments.Select(arg => arg.MapURIs(old_to_new)).ToList()
);
MaZiFAU
committed
public class OMS : SOMDocCRTP<OMS> //OMSTR?
public new string kind = "OMS";
public string uri;
[JsonConstructor]
public OMS(string uri) : base()
MaZiFAU
committed
protected override bool EquivalentWrapped(OMS sd2)
=> this.uri == sd2.uri;
protected internal override LambdaExpression GetLambdaExpression(LambdaExpression[] lambda_args, ParameterExpression[] bound_params)
=> SOMDoctoLambdaExpression<float>.MakeLambdaExpression(uri, lambda_args, bound_params);
public override string ToString()
=> uri;
public override OMS MapURIsWrapped(Dictionary<string, string> old_to_new)
{
if (!old_to_new.TryGetValue(uri, out string new_uri))
new_uri = uri;
return new OMS(new_uri);
}
MaZiFAU
committed
public class OMSTR : SOMDocCRTP<OMSTR>
public new string kind = "OMSTR";
[JsonProperty("float")]
public string s;
public OMSTR(string s) : base()
MaZiFAU
committed
protected override bool EquivalentWrapped(OMSTR sd2)
=> this.s == sd2.s;
protected internal override LambdaExpression GetLambdaExpression(LambdaExpression[] lambda_args, ParameterExpression[] bound_params)
=> Expression.Lambda(Expression.Constant(s, typeof(string)), null);
public override string ToString()
=> s;
public override OMSTR MapURIsWrapped(Dictionary<string, string> old_to_new)
=> (OMSTR)this.MemberwiseClone();
MaZiFAU
committed
public class OMF : SOMDocCRTP<OMF>
public new string kind = "OMF";
public OMF(float f) : base()
MaZiFAU
committed
protected override bool EquivalentWrapped(OMF sd2)
MaZiFAU
committed
protected internal override LambdaExpression GetLambdaExpression(LambdaExpression[] lambda_args, ParameterExpression[] bound_params)
=> Expression.Lambda(Expression.Constant(@float, typeof(float)), null);
public override string ToString()
public override OMF MapURIsWrapped(Dictionary<string, string> old_to_new)
=> (OMF)this.MemberwiseClone();
MaZiFAU
committed
public class OMC<T> : SOMDocCRTP<OMC<T>>
public new string kind = "OMC<" + typeof(T) + ">";
public T value;
[JsonConstructor]
public OMC(T value) : base()
MaZiFAU
committed
protected override bool EquivalentWrapped(OMC<T> sd2)
{
Debug.LogWarning("Cannot check Equivalency for " + this.GetType() + "; only whether it's exact!");
return this.value.Equals(value);
}
protected internal override LambdaExpression GetLambdaExpression(LambdaExpression[] lambda_args, ParameterExpression[] bound_params)
=> Expression.Lambda(Expression.Constant(value, typeof(T)), null);
public override string ToString()
=> "C_" + typeof(T) + "(" + value.ToString() + ")";
public override OMC<T> MapURIsWrapped(Dictionary<string, string> old_to_new)
=> (OMC<T>)this.MemberwiseClone();
MaZiFAU
committed
public class OMV : SOMDocCRTP<OMV>
public new string kind = "OMV";
public string name;
[JsonConstructor]
MaZiFAU
committed
protected override bool EquivalentWrapped(OMV sd2)
MaZiFAU
committed
protected internal override LambdaExpression GetLambdaExpression(LambdaExpression[] lambda_args, ParameterExpression[] bound_params)
ParameterExpression v = bound_params.FirstOrDefault(param => param.Name.Equals(name));
if (v == null)
{
Debug.LogErrorFormat("Unable to find {0} for {1} with name: {2}", nameof(OMBINDC), nameof(OMV), name);
return Expression.Lambda(Expression.Empty(), null);
}
else
return Expression.Lambda(v, new[] { v });
}
public override string ToString()
public override OMV MapURIsWrapped(Dictionary<string, string> old_to_new)
=> (OMV)this.MemberwiseClone();
[JsonConverter(typeof(JsonSubtypes), "kind")]
[JsonSubtypes.KnownSubType(typeof(MMTSymbolDeclaration), "general")]
[JsonSubtypes.KnownSubType(typeof(MMTValueDeclaration), "veq")]
public abstract class MMTDeclaration
public string label;
public static MMTDeclaration FromJson(string json)
{
MMTDeclaration mmtDecl = JsonConvert.DeserializeObject<MMTDeclaration>(json);
public static string ToJson(MMTDeclaration mmtDecl)
{
string json = JsonConvert.SerializeObject(mmtDecl);
public abstract string getType();
public abstract string getApplicant();
/// <summary>MMTSymbolDeclaration: Class for facts without values, e.g. Points</summary>
public class MMTSymbolDeclaration : MMTDeclaration
public new string kind = "general";
[JsonProperty("tp")]
public SOMDoc type;
[JsonProperty("df")]
public SOMDoc defines;
[JsonConstructor]
private MMTSymbolDeclaration() { }
/// <summary>Constructor used for sending new declarations to mmt</summary>
public MMTSymbolDeclaration(string label, SOMDoc type, SOMDoc defines)
{
this.label = label;
public override string getType()
{
{
OMS oMS => oMS.uri,
OMA oMA => ((oMA.arguments[0] as OMA).applicant as OMS).uri,
_ => null
};
}
public override string getApplicant()
{
{
OMA oMA when oMA.applicant is OMS oMS => oMS.uri,
_ => null
};
}
/// <summary>MMTValueDeclaration: Class for facts with values, e.g. Distances or Angles</summary>
public class MMTValueDeclaration : MMTDeclaration
public new string kind = "veq";
MaZiFAU
committed
public SOMDoc lhs;
MaZiFAU
committed
public SOMDoc value;
[JsonConstructor]
private MMTValueDeclaration() { }
/// <summary>Constructor used for sending new declarations to mmt</summary>
public MMTValueDeclaration(string label, SOMDoc lhs, SOMDoc valueType, SOMDoc value, SOMDoc proof = null)
{
this.label = label;
this.lhs = lhs;
John Schihada
committed
this.value = value;
this.proof = proof;
}
public override string getType()
{
return lhs switch
{
OMA oMA when oMA.applicant is OMS oMS => oMS.uri,
_ => null
};
}
public override string getApplicant()
{
return lhs switch
{
OMA oMA when oMA.applicant is OMS oMS => oMS.uri,
_ => null
};