Beispiel #1
0
        public static new Fact FromExpression(GdlExpression exp)
        {
            if (exp is GdlAtom)
                return GroundFact.FromExpression(exp);

            var list = exp as GdlList;
            if (list != null)
                return FromList(list);

            // unknown expression type
            throw new Exception("GroundFact.fromExpression: don't know how to handle expressions of type " + exp.GetType().Name);
        }
Beispiel #2
0
        private void ExamineTerm(GdlExpression exp)
        {
            var atom = exp as GdlAtom;
            if (atom != null)
                ExamineAtomTerm(atom);

            else if (exp is GdlVariable)
                ExamineVariableTerm();

            else
            {
                var list = exp as GdlList;
                if (list != null)
                    ExamineListTerm(list);
                else
                    throw new Exception("MetaGdl.examineTerm: can't handle expressions of type " + exp.GetType().Name);
            }
        }